Dynamic Routing

2008-10-25 Thread deedod

What's the best way to go about setting up dynamic routing
so that I can redirect all my 'missing controller' errors to another
defined controller to perform operations on?

I basically want any error page to filter through the pages controller
(or any other controller I choose) so I can check the requested URL
and determine if the URL is valid or not.

I have some other defined controllers that I use as normal but I also
want the ability to define custom URLs for a page and then to be
able to pull the data for that page after checking the URL requested.

Should I use some sort of routing?  Or is there another approach I
should use.  I don't want to redirect ALL pages to the specified
controller since I have a couple other controllers that I use.

Also, is there a way that you can pass control from one controller
to another?  For instance, I'm in the pages controller but is there a
way to jump to another controller on the fly?

Any help would be great.

Thanks.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: can i cache descripe query ?

2008-10-25 Thread Adrianifero

Can you post documentation??  This is a popular one nowadays for
people on the group..

On Oct 12, 7:11 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> Can you read the documentation ?
>
> On Sun, Oct 12, 2008 at 7:37 PM, [EMAIL PROTECTED]
>
> <[EMAIL PROTECTED]> wrote:
>
> > can i cache it ?
> > Nr      Query   Error   Affected        Num. rows       Took (ms)
> > 1      DESCRIBE`aros`         7       7       14
> > 2      DESCRIBE`acos`         7       7       13
> > 3      DESCRIBE`aros_acos`            7       7       14
> > 4      DESCRIBE`users`                9       9       15
> > 5      DESCRIBE`roles`                2       2       14
> > 6      DESCRIBE`countries`            2       2       15
> > 7      DESCRIBE`tracker`              10      10      14

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Hosting

2008-10-25 Thread tracyfloyd

I recently got into a Liquid Web VPS (www.liquidweb.com) and it has
been great for me. Great support as well. I have a TextDrive account
and second the comment on those guys being great, They are smart folks
who really know their stuff.

Let us know what you decide and how it goes...

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Filter HABTM associations

2008-10-25 Thread lazyeye

Here is my table setup:

posts
id
name
...

tags
id
parent_id
name
...

posts_tags
id
post_id
tag_id

I want to be able to filter posts by their associated "parent tag". So
for example I want to be able to request all posts with an associated
tag whose parent tag has an id of 1.

Currently I am able to filter posts by tag but not "parent tag" using
the technique described in the manual at 
http://book.cakephp.org/view/83/hasAndBelongsToMany-HABTM.

This technique requires two "hasOne" relationships in the Post model,
one for the "PostsTag" model and one for the "Tag" model under an
alias of "FilterTag" with no foreign key and a condition of
FilterTag.id = QuestionsTag.tag_id.  You can then filter by tag by
specifying a FilterTag.id in your search conditions.

The problem with this technique is that if a post has more than one
tag with the same parent_id that posts will show up in the results
twice.

Besides removing duplicate posts after the request using PHP is there
any way to filter by "parent tag".  This problem has been bugging me
for a couple of days now and I would greatly appreciate any help in
this matter.

Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



not understanding simple HABTM save/delete

2008-10-25 Thread RyOnLife


After spinning my wheels for a few hours on this one, any help would be very
appreciated...

I have an 'Item' model:

class Item extends AppModel {  
  var $name = 'Item';  
  var $hasAndBelongsToMany = 'Label';
}

A 'Label' model:

class Label extends AppModel {  
  var $name = 'Label';  
  var $hasAndBelongsToMany = 'Item';
}

And an 'items_labels' join table:

CREATE TABLE `items_labels` (
  `item_id` int(11) NOT NULL,
  `label_id` int(11) NOT NULL,
  `created` datetime default NULL
);

I cannot figure out how to save a simple record (association) to the join
table. I just don't understand what I need to put in my
'labels_controller.php' to get this result, for example:

INSERT INTO `database_name`.`items_labels` (`item_id`, `label_id`,
`created`) VALUES ('1', '1', NOW());

After many failed attempts, I'm back to an empty action:

function update($item_id, $label_id) {

}

In addition to save(), help with delete() would also be appreciated.

And not sure if it has any bearing on the solution, but for this action, I
am not concerned with any of the records in the 'items' or 'labels' tables.

Many thanks!

-Ryan
-- 
View this message in context: 
http://n2.nabble.com/not-understanding-simple-HABTM-save-delete-tp1377073p1377073.html
Sent from the CakePHP mailing list archive at Nabble.com.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Wampserver and Cake Bake

2008-10-25 Thread soldier.coder

One more thing...  It is hard to diagnose the problem without seeing
the exact symptoms.  Could you post the exact text of the error?

And... do you have a prior version of MySql running as a service?

Just some thoughts.



On Oct 24, 5:41 pm, Merk <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have an installation of wampserver version 2.0 on my machine.  I'm
> attempting to use the cake bake console from the command line.  When I
> do so, I get mysql_undefined errors.
>
> Obviously the first step is to check the php.ini's to ensure
> the .dll's aren't commented out.  I've checked 3 different .ini files
> on my machine under the wamp directory, and all show this is enabled.
>
> php_info(); shows mysql is running.
>
> I even found a php_old.ini in the windows folder on my machine and
> enabled the extensions there.  No luck.
>
> Has anyone else run into this problem with wampserver?  Any ideas to
> troubleshoot?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Load Data from other table

2008-10-25 Thread thatsgreat2345

Thanks, but I totally forgot about the $uses variable.

On Oct 25, 4:18 pm, RyOnLife <[EMAIL PROTECTED]> wrote:
> If it's something as simple as a site 
> name,http://n2.nabble.com/How-to-use-Components-in-Views--tp1377006p137719...
> this  might help. Just use 'site_name' instead of 'site_id' and that will do
> the trick.
>
> thatsgreat2345 wrote:
>
> > I am making a site and for the index, and contact, and TOS, and other
> > stuff I have it running on GeneralController. I may end up selling the
> > script and so Site Name is saved in the General table. Is there an OOP
> > way to access the General table with out defining a $hasone/$belongsto
> > or anything like that?
>
> --
> View this message in 
> context:http://n2.nabble.com/Load-Data-from-other-table-tp1377212p1377223.html
> Sent from the CakePHP mailing list archive at Nabble.com.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Load Data from other table

2008-10-25 Thread RyOnLife


If it's something as simple as a site name, 
http://n2.nabble.com/How-to-use-Components-in-Views--tp1377006p1377198.html
this  might help. Just use 'site_name' instead of 'site_id' and that will do
the trick.


thatsgreat2345 wrote:
> 
> 
> I am making a site and for the index, and contact, and TOS, and other
> stuff I have it running on GeneralController. I may end up selling the
> script and so Site Name is saved in the General table. Is there an OOP
> way to access the General table with out defining a $hasone/$belongsto
> or anything like that?
> > 
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/Load-Data-from-other-table-tp1377212p1377223.html
Sent from the CakePHP mailing list archive at Nabble.com.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Is the cookbook broken, or is it just me?

2008-10-25 Thread jjh

Cookbook is back up now... Thank you Cake Team.

On Oct 25, 3:58 pm, Brenda <[EMAIL PROTECTED]> wrote:
> Thank you so much. Your efforts on a Saturday night are much
> appreciated! May the rest of your evening be peaceful.
>
> On Oct 25, 6:33 pm, Gwoo <[EMAIL PROTECTED]> wrote:
>
> > We are working on fix. Should be back up soon.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: css menu helper mouseover broken

2008-10-25 Thread Dardo Sordi Bogado

It's a well known IE rendering bug (also the solution is well known),
just google it...

On Sat, Oct 25, 2008 at 3:14 PM, Adam Royle <[EMAIL PROTECTED]> wrote:
>
> I workaround this problem by defining a different margin-bottom value
> for IE using conditional styles...
>
> 
>
>
>
> On Oct 26, 12:52 am, rogwei <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> I added a comment in the Bakery to the CSS Menu Helper page 
>> here:http://bakery.cakephp.org/articles/view/css-menu-helper
>>
>> Here is a duplicate of my comment:
>>
>> #begin comment
>> 4 gap between parent and child breaks menu
>> In IE and Opera, there is a small but visible gap between the parent
>> li and the child li that breaks the menu functionality. For some
>> reason, Firefox renders the parent and child li elements without the
>> gap, so you can move the mouse easily from one to the other without
>> the child li elements disappearing. Obviously, the gap translates to a
>> mouseout event which removes the child li elements. With some effort
>> (in IE and Opera), I can move the mouse quickly enough but not too
>> far, so that I am able to mouseover the child element before the
>> mouseout on the parent is handled. That's all beside the point. The
>> real question is what is causing the gap and how to get rid of it. I
>> am using the css_menu.css as is. Fwiw, here is my helper function call
>> echo $cssMenu->menu(array('Activities'=> array('Add'=> $this->base.'/
>> activities/add','List'=> $this->base.'/activities/index')),'down');
>> #end comment
>>
>> I haven't gotten a reply. Has anyone else noticed this behavior or can
>> suggest a fix? Thanks much.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Tags implementation

2008-10-25 Thread RyOnLife


I'm having some trouble with save/delete HABTM myself, but I can at least
help you on your table design. Following Cake conventions (plural,
lowercase, abc order) and assuming you want everything taggable, your join
tables would be:

tags_users (tag_id, user_id)
brands_tags (brand_id, tag_id)
products_tags (product_id, tag_id)
posts_tags (post_id, tag_id)
-- 
View this message in context: 
http://n2.nabble.com/Tags-implementation-tp1376700p1377213.html
Sent from the CakePHP mailing list archive at Nabble.com.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Load Data from other table

2008-10-25 Thread thatsgreat2345

I am making a site and for the index, and contact, and TOS, and other
stuff I have it running on GeneralController. I may end up selling the
script and so Site Name is saved in the General table. Is there an OOP
way to access the General table with out defining a $hasone/$belongsto
or anything like that?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Is the cookbook broken, or is it just me?

2008-10-25 Thread Brenda

Thank you so much. Your efforts on a Saturday night are much
appreciated! May the rest of your evening be peaceful.

On Oct 25, 6:33 pm, Gwoo <[EMAIL PROTECTED]> wrote:
> We are working on fix. Should be back up soon.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to use Components in Views?

2008-10-25 Thread RyOnLife


I've set a few configurations in my core.php:

Configure::write('site_id', 1);

Which you can get at from your views:


-- 
View this message in context: 
http://n2.nabble.com/How-to-use-Components-in-Views--tp1377006p1377198.html
Sent from the CakePHP mailing list archive at Nabble.com.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How should I implement two login Section 1: User Login 2: Business Login

2008-10-25 Thread RyOnLife


I've got a similar need in the app I am working on and elected to go with the
single users table. Working with two instances of Auth sounds messy.

$this->Auth->userScope = array('Model.field' => 'value');

You can set 'field' to something like 'group_id' and have a 'groups' table.
If the degrees of difference between regular and business users is
significant, I'd go the ACL route.
-- 
View this message in context: 
http://n2.nabble.com/How-should-I-implement-two-login-Section-1%3A-User-Login--2%3A-Business--Login-tp1377159p1377187.html
Sent from the CakePHP mailing list archive at Nabble.com.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How should I implement two login Section 1: User Login 2: Business Login

2008-10-25 Thread [EMAIL PROTECTED]

Hi,

I am working on a site and want to implement two types of users with
different  logins
like: http://www.naukri.com/
1. User Login
2. Business Login

There are three ways of doing this
1) We can have only one users table and using $userScope we
distinguish between both type of logins ..
but not sure will $userScope works for this ?

Where $userScope is Auth variable

2) We can have two tables users and businesses and two different Auth
APIs,
a): users
b): businesses

But can two Auth work ? If yes, then how ?

3) Can I do it by Auth using ACL?  if yes then how?

Also, please suggest if you have better solution for this ?

Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to use Components in Views?

2008-10-25 Thread Gwoo

Actually, it is not simple because it would be wrong to use a
component in the view. This is why you cannot find the information in
the docs. If you need some data you can set it in the beforeRender
callback.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Disabling Cake's error handling for CLI commands.

2008-10-25 Thread Gwoo

you can use Debugger::output('txt')
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Need help getting site to work

2008-10-25 Thread Ozzy OG Kush

I'm using CakePHP 1.1, and Apache 2.2.

On Oct 24, 4:45 pm, Ozzy OG Kush <[EMAIL PROTECTED]> wrote:
> Here's my situation. I have my site (http://www.phillynorml.org/) set
> up in a production environment (index.php, .htaccess, img, css, js,
> etc in ../DocumentRoot, everything else in ../cake, and it's working
> great for the most part.
>
> The problem is that in DocumentRoot I have another folder with a perl
> program in it, but when you go to the URL of that program, cake throws
> up a 404 error (http://www.phillynorml.org/medijuana/showpage.pl?
> page=main) .
>
> How can I set it up so that it will run?
>
> Also, on a semi-related note, how can I tell cake to never display SQL
> connection errors?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Is the cookbook broken, or is it just me?

2008-10-25 Thread Gwoo

We are working on fix. Should be back up soon.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Is the cookbook broken, or is it just me?

2008-10-25 Thread Jared

Not just you.  I can't see anything either.  Bummer.


On Oct 25, 2:56 pm, Brenda <[EMAIL PROTECTED]> wrote:
> I'm trying to access the cookbook athttp://book.cakephp.org/, but all
> I see is a bunch of 'This section is yet to be written.' It worked
> fine last night. Perhaps someone is working on it, or is it just me?
>
> Thank you for your help.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: book.cakephp is down

2008-10-25 Thread Gwoo

#cakephp on irc.freenode.net is the place to report.

We are working on the problem. Should be back up very soon.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



book.cakephp is down

2008-10-25 Thread jjh

Sorry, I don't know who to report about http://book.cakephp.org/ being
down so I just leave a message here. I see "This section has yet to be
written" all over the place.

Cake is awesome!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Is the cookbook broken, or is it just me?

2008-10-25 Thread Brenda

I'm trying to access the cookbook at http://book.cakephp.org/, but all
I see is a bunch of 'This section is yet to be written.' It worked
fine last night. Perhaps someone is working on it, or is it just me?

Thank you for your help.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Wampserver and Cake Bake

2008-10-25 Thread soldier.coder

Ok, I got 3 suggestions for you:

1) write a simple php script that echos "hello" and run it from a CMD
box.  Does it run?  if not find out the path to where your php runs
from and add it to your path.

2) add to your path the path to the console section of your cake app.
I have an app called "Gradebook" so I have in my path "c:\wamp\www
\gradebook\cake\console;" in my path.

3) make *SURE* you are in the right directory.  In my example, to use
the command like of: "cake bake", I need to be in the directory "C:
\wamp\www\gradebook\app\"

That will let you bake if you have everything else set up.  If you
don't have everything set up right and you are running wampserver you
can tell that right away just by looking at the gauge in the area near
your time.  If the guage has any red in it, your databaserver or your
apache is not set up right and it will not work.


On Oct 24, 5:41 pm, Merk <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have an installation of wampserver version 2.0 on my machine.  I'm
> attempting to use the cake bake console from the command line.  When I
> do so, I get mysql_undefined errors.
>
> Obviously the first step is to check the php.ini's to ensure
> the .dll's aren't commented out.  I've checked 3 different .ini files
> on my machine under the wamp directory, and all show this is enabled.
>
> php_info(); shows mysql is running.
>
> I even found a php_old.ini in the windows folder on my machine and
> enabled the extensions there.  No luck.
>
> Has anyone else run into this problem with wampserver?  Any ideas to
> troubleshoot?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to use Components in Views?

2008-10-25 Thread [EMAIL PROTECTED]

Hi,

Must be extremely simple but I've searched all around the docs and I
just can't seem to find it, but how do I use component code in a view?

I've made a component to handle settings from a DB, so in my views, I
want things like:

if ($component->settings['status'] == '1') {
 echo 'Hello!';
}

to work in my views.

Thanks.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cakephp shell configuration

2008-10-25 Thread majna

 http://cakephp.org/screencasts/view/6 ?


On Oct 25, 7:47 am, mirfan <[EMAIL PROTECTED]> wrote:
> Hi,
> I am using windows XP 2002 i am not able to configure shell please
> help me to do so
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Hosting

2008-10-25 Thread djXternal

I just recently switched from GoDaddy, as they have a massive lack of
support for cake, to WestHost.com.  I have been extremely pleased with
WestHost so far, and cake works like a dream.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Problem with Multivalidatable on hosted service ...

2008-10-25 Thread Dardo Sordi Bogado

Hi Rob, it seems that the behavior isn't being attached to your model.
Try putting a die("Multivalidatable") at the begining of the
multivalidatable.php.

If that kills your app, then it's beign loaded, then add a die() in
Multivalidatable::setUp()

function setUp(&$model, $config = array()) {
die("is beign initizlized in {$model->name}");
  // <-- add this die() or a pr()
$this->__defaultRules[$model->name] = $model->validate;
}

If it's beign loaded, then it may be a problem with cake behaviors
method dispatching, probably because of a PHP setting/version issue,
try running the core behavior tests and upgrading/downgrading the core
if something fails.

Let me know how far you get.

Regards,
- Dardo Sordi.

On Fri, Oct 24, 2008 at 9:36 PM, Rob <[EMAIL PROTECTED]> wrote:
>
> I have an application that is working fine on my local machine using
> the behavior of Multivalidatable (see
> http://bakery.cakephp.org/articles/view/multivalidatablebehavior-using-many-validation-rulesets-per-model)
>
> When I run it from my local machine (where I have control of the
> httpd.conf), it works just fine.
>
> When I run it on my hosting provider (1and1), I get an error:
>
> Warning (512): SQL Error: 1064: You have an error in your SQL syntax;
> check the manual that corresponds to your MySQL server version for the
> right syntax to use near 'setvalidation' at line 1 [CORE/cake/libs/
> model/datasources/dbo_source.php, line 521
>
> The method in question is in the Multivalidatable.php class under ~/
> VolunteerCake/models/behaviors, which seems to be the right place
> locally.
>
> My cake directory is at ~/cake, and everything else seems to be
> working OK (including the 'Acl' declaration).
>
> BTW, in order to get the app to work on 1and1, I had to modify
> the .htaccess files to make the paths absolute as described here:
> http://bakery.cakephp.org/articles/view/mod-rewrite-on-godaddy-shared-hosting
>
> Any ideas on what to do to correct this ?
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Tags implementation

2008-10-25 Thread bookme

Hi,

I want to implement tag functionality for my site.

I have four modal
1 Tag
2 User
3 Brand
4 Product
5 Post

I am thinking to make two tables
tags : id, tag_name
entities_tags : tag_id, entity_id, entity_type

here entity is User, Brand,  Post and their corresponding ids..

Should I follow this above design or make a different join table for
each entity like;

tags : id, tag_name
tags_users : tag_id, user_id
brands_tags: brand_id, tag_id
posts_tags: post_id, tag_id

please tell me in terms of save, edit, delete, get..searching for  a
tag name which one is best design for CakePHP
thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



BelongsTo work using bind but not on model

2008-10-25 Thread nanomag

Hi,

I've got 3 tables

users, events and user_has_events

In my model user, I have added the relation hasmany on
user_has_events, did same thing on event model.
user_has events must have 2 relations belongsTo.
Each record in this table have one and only one event and one and only
one user
I've tried to assign in belongsTo var but nothing works

var $belongsTo = array('User');
var $belongsTo = 'User';
var $belongsTo = array('User' => array('className'=>
'User','foreignKey'=> 'user_id'));

In the controller, I made a print_r to see associated models
echo ""; print_r($this->EventsHasUsers->getAssociated());echo "";
with every exemples above, the array is always empty
but if I do
$this->EventsHasUsers->bindModel(array('belongsTo' => array('User' =>
array('className' => 'User';
the array getAssociated contains

Array
(
[User] => belongsTo
)
Where is my error ?
thanks for helping.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Set::extract issue - array must start with [0] index

2008-10-25 Thread senser

Hello,

I have problem using Set::extract class. Here is an example array
$test:

Array
(
[3181] => Array
(
[Sync] => Array
(
[id] => 3181
[synced] => 0
)
)

On this array Set::extract('/Sync[id=3181]', $test) returns an empty
result but if I change the array like this

Array
(
[0] => Array
 (
  )
[3181] => Array
(
[Sync] => Array
(
[id] => 3181
[synced] => 0
)
)

and Set::extract('/Sync[id=3181]', $test) gives the right result.  My
conclusion is that Set:extract needs the first element of an array to
be with zero index - am I wrong or missing something.

Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Can't access the User's associated model with AuthComponent

2008-10-25 Thread gravyface

Hello,

I have User hasOne Profile and Profile belongsTo User set up as 
associated models.

I'm using the AuthComponent to to do simple/basic authentication; my 
login action is empty.

When authenticating, the Profile model data is retrieved along with the 
User model data (I see it in my debug footer that it's JOINing on the 
profiles table).  If auth succeeds, $this->Auth->user() data is set.

However, I'd also like to set Profile.id in session at this time instead 
of querying the database base again with a User->find, but I don't see 
where I can do that; there's no callbacks in Auth that I can see.

Any ideas?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Resetting Lost Passwords

2008-10-25 Thread Smelly_Eddie

Thanks Martin.
Looks like the same concept, I noticed some things that made me
curios.

In implementation did you include the functionality within a users
component or a separate one dedicated to tickets?  Do you have a
different method to let logged in users change their credentials?

I am going to work on pulling more functionality out into the actual
component, and the same for the botcheck, which I have already begun.
I have such a poor patience to draw things before I get coding, and
mostly end up refactoring afterwards.


Regards,

EW

On Oct 24, 5:40 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> You got some nice functionality there. I think it could be reorganised
> a bit. At least from how I see a ticket system. I went with a slightly
> different approach a few years ago when I needed similar
> functionality. It is the same basic functionality but the code has a
> different organisation from your 
> code.http://bakery.cakephp.org/articles/view/ticket-component-resetting-us...
>
> -The component deals only with ticket management and is the only place
> where tickets are created and managed.
> -Generally components should not have their own models I hear but in
> this situation it is totally valid, I think.
> -The controller uses the component to create and check and use
> tickets, for password resets in this case.
> -Another controller uses the same ticket component to keep sessions
> alive and "pseudo authenticate" requests from embedded plugins.
>
> I still use it and like it. Maybe you see some detail or two you like.
> /Martin
>
> On Oct 24, 10:51 pm, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
>
> > Allowing users the ability to change passwords is a no brainer.
>
> > But what do you do if a user losses their password?  Several months
> > ago I wrote a very simple component that works in conjunction with my
> > user model to issue tickets to user emails.
>
> > The ticket can be retrieved via email and allows users to enter a new
> > password.
>
> > The tickets are valid for 24 hours, carry a unique code that aligns to
> > that users email.  It is the bet way I could think to solve this
> > issue.
>
> > If you want to check it out and share advice, please do.
>
> >http://edwardawebb.com/programming/php-programming/cakephp/reset-lost...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: css menu helper mouseover broken

2008-10-25 Thread Adam Royle

I workaround this problem by defining a different margin-bottom value
for IE using conditional styles...





On Oct 26, 12:52 am, rogwei <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I added a comment in the Bakery to the CSS Menu Helper page 
> here:http://bakery.cakephp.org/articles/view/css-menu-helper
>
> Here is a duplicate of my comment:
>
> #begin comment
> 4 gap between parent and child breaks menu
> In IE and Opera, there is a small but visible gap between the parent
> li and the child li that breaks the menu functionality. For some
> reason, Firefox renders the parent and child li elements without the
> gap, so you can move the mouse easily from one to the other without
> the child li elements disappearing. Obviously, the gap translates to a
> mouseout event which removes the child li elements. With some effort
> (in IE and Opera), I can move the mouse quickly enough but not too
> far, so that I am able to mouseover the child element before the
> mouseout on the parent is handled. That's all beside the point. The
> real question is what is causing the gap and how to get rid of it. I
> am using the css_menu.css as is. Fwiw, here is my helper function call
> echo $cssMenu->menu(array('Activities'=> array('Add'=> $this->base.'/
> activities/add','List'=> $this->base.'/activities/index')),'down');
> #end comment
>
> I haven't gotten a reply. Has anyone else noticed this behavior or can
> suggest a fix? Thanks much.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Disabling Cake's error handling for CLI commands.

2008-10-25 Thread Mathew

I think I figured it out.

Adding the following to my Cake loader seems to work.

define('DISABLE_DEFAULT_ERROR_HANDLING', true);
define('CAKEPHP_SHELL', true);

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Disabling Cake's error handling for CLI commands.

2008-10-25 Thread Mathew

Hi,

I am working on some controller actions that can only be run from the
command line, and if there is a PHP error then cake dumps out error
messages wrapped in HTML. When you try to read these error message
from the command line it's impossible to see what the error was.

Is there a way to disable Cake's error handling, and just allow the
regular PHP error to be thrown?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



css menu helper mouseover broken

2008-10-25 Thread rogwei

Hi,

I added a comment in the Bakery to the CSS Menu Helper page here:
http://bakery.cakephp.org/articles/view/css-menu-helper

Here is a duplicate of my comment:

#begin comment
4 gap between parent and child breaks menu
In IE and Opera, there is a small but visible gap between the parent
li and the child li that breaks the menu functionality. For some
reason, Firefox renders the parent and child li elements without the
gap, so you can move the mouse easily from one to the other without
the child li elements disappearing. Obviously, the gap translates to a
mouseout event which removes the child li elements. With some effort
(in IE and Opera), I can move the mouse quickly enough but not too
far, so that I am able to mouseover the child element before the
mouseout on the parent is handled. That's all beside the point. The
real question is what is causing the gap and how to get rid of it. I
am using the css_menu.css as is. Fwiw, here is my helper function call
echo $cssMenu->menu(array('Activities'=> array('Add'=> $this->base.'/
activities/add','List'=> $this->base.'/activities/index')),'down');
#end comment

I haven't gotten a reply. Has anyone else noticed this behavior or can
suggest a fix? Thanks much.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: A case study of a real-world migration to CakePHP 1.2

2008-10-25 Thread teknoid

just a few things off top of my head...

- validation rules and new validation options in 1.2
- containable behavior to restrict model bindings
- 1.2 rc1+ ... the operators in find() moved to the key side, i.e.
('ModelName.Field LIKE'=>'apple')
- Don't remember for sure how it was in 1.1, but url() should now be
written as an array notation, rather than just (/controller/action)
- Changes to config keys in database.php
- Quite a few changes in core.php

This is a very useful and ambitious effort, and I certainly hope you
follow through with it to the end :)
Considering 1.2 stable is just around the corner, we'll see a lot more
people hopefully making the switch and this type of guide would be
incredible to have...

On Oct 24, 3:57 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Hi,
> I am in the process of migrating my very first CakePHP application to
> 1.2. I decided to try to keep track of my migration steps in a case-
> study.
>
> Considering how much CakePHP has evolved and also how many beginner-
> mistakes I have put into this application, this migration will also
> describe some enormous optimizations that was possible because of new
> features and my improved knowledge of CakePHP.
>
> This is a work in progress and I welcome any comments and suggestions.
> For example: if you feel something could be explained in further
> detail or is missing let me know.
>
> The document can be seen on the following page. It is still a work in
> progress with no layout. It is simply saved as html in TextEdit until
> is is more complete.http://dev.eimermusic.com/migration/
>
> Headings so far include:
>
> Oh crap, nothing works.
> File model clashes with the File class
> Replacing authentication
> Permissions
> Transitioning old passwords
> Changing the code convention of the entire application
> Removing requestAction()
> l10n and i18n
> Changing all view-files to use .ctp extension
> Consolidating layouts and views.
>
> Let me know if you find any of it useful.
> /Martin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: External Referer URL in CakePHP Page Header Issue

2008-10-25 Thread Raph

What about "http" and "https"? I'm using the language controller form:
http://bakery.cakephp.org/articles/view/p28n-the-top-to-bottom-persistent-internationalization-tutorial,
and in "change" method there is, a line:

$this->redirect($this->referer(null, true));

The problem is if I use my app via https protocol It always redirects
me to start page during the language changing. If I change that line
to:

$this->redirect($this->referer());

everything is ok. Is it means that https urls are for Cake external?
Are there any security issues if I use referer not only for local urls?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



CLI has stopped working

2008-10-25 Thread Carlos

Hello everybody

Since yesterday, everytime I try to cake bake views my windows vista box 
come with the following error: CLI has stopped working

does anybody know about that issue?

thanks a lot

Carlos

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Problem with Multivalidatable on hosted service ...

2008-10-25 Thread Rob

I have an application that is working fine on my local machine using
the behavior of Multivalidatable (see
http://bakery.cakephp.org/articles/view/multivalidatablebehavior-using-many-validation-rulesets-per-model)

When I run it from my local machine (where I have control of the
httpd.conf), it works just fine.

When I run it on my hosting provider (1and1), I get an error:

Warning (512): SQL Error: 1064: You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the
right syntax to use near 'setvalidation' at line 1 [CORE/cake/libs/
model/datasources/dbo_source.php, line 521

The method in question is in the Multivalidatable.php class under ~/
VolunteerCake/models/behaviors, which seems to be the right place
locally.

My cake directory is at ~/cake, and everything else seems to be
working OK (including the 'Acl' declaration).

BTW, in order to get the app to work on 1and1, I had to modify
the .htaccess files to make the paths absolute as described here:
http://bakery.cakephp.org/articles/view/mod-rewrite-on-godaddy-shared-hosting

Any ideas on what to do to correct this ?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: decrypt password

2008-10-25 Thread Daniel Hofstetter

Hi,

> i m encrypted my password with $this->Auth->password ,but noe i want
> to decrypt that password , how can i do that?

You can't, because a hash function is used to "encrypt" your password.
And from a hash value you can't get back the original value by design.

Why do you want to decrypt the password?

--
Daniel Hofstetter
http://cakebaker.42dh.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: decrypt password

2008-10-25 Thread Bernhard J. M. Grün
Hi!

This is impossible as CakePHP uses a hash function to encrypt them. A
hash function is a one way function. So there is no way to decrypt
them again.
-- Bernhard J. M. Grün



2008/10/25 [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
>
> hi,
> i m encrypted my password with $this->Auth->password ,but noe i want
> to decrypt that password , how can i do that?
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: A case study of a real-world migration to CakePHP 1.2

2008-10-25 Thread Daniel Hofstetter

Hi Martin,

> I am in the process of migrating my very first CakePHP application to
> 1.2. I decided to try to keep track of my migration steps in a case-
> study.
>
> Considering how much CakePHP has evolved and also how many beginner-
> mistakes I have put into this application, this migration will also
> describe some enormous optimizations that was possible because of new
> features and my improved knowledge of CakePHP.
>
> This is a work in progress and I welcome any comments and suggestions.
> For example: if you feel something could be explained in further
> detail or is missing let me know.
>
> The document can be seen on the following page. It is still a work in
> progress with no layout. It is simply saved as html in TextEdit until
> is is more complete.http://dev.eimermusic.com/migration/
>
> Headings so far include:
>
> Oh crap, nothing works.
> File model clashes with the File class
> Replacing authentication
> Permissions
> Transitioning old passwords
> Changing the code convention of the entire application
> Removing requestAction()
> l10n and i18n
> Changing all view-files to use .ctp extension
> Consolidating layouts and views.

I think it is useful to have such a migration case study.

What I'm missing is something about the Html/Form helpers and about
loading external files (vendors() function in 1.1 vs. App::import() in
1.2)

Hope that helps!

--
Daniel Hofstetter
http://cakebaker.42dh.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



decrypt password

2008-10-25 Thread [EMAIL PROTECTED]

hi,
i m encrypted my password with $this->Auth->password ,but noe i want
to decrypt that password , how can i do that?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---