define('DEBUG', 0) problem
Greetings! I was developing a site using the development debug mode (1). Then I was finished, hooray! and I put it live and set the debug value to production mode (0). The strange thing is that my site now is immensly slow and if it loads at all, the styles don't... If i set the debug mode back to 1 everything runs ok. Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Model associations problem
Well, the condition is not included in the SQL. So that is why I'm not getting any errors when I create a condition that should create an error... I have removed all files in app/tmp/cache/models, if that is the right way to clear the model caches then I have. If not, how can I do that? Thanks for your reply, Ruud --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Model associations problem
No-one has an answer? I'd say a lot of people use the same construction so it won't be that hard ... I just don't know how. On Aug 6, 3:01 am, Ruud Gâst <[EMAIL PROTECTED]> wrote: > Hello there, > > I've got a simple construction of two models: users and familymembers; > every user belongs to a familymember and a familymember has one user. > So the database looks like this: > > `familymembers` ( > `id` int(11) auto_increment, > `firstname` varchar(20), > `lastname` varchar(100), > `gender` tinyint(4), > `dob` date, > `email` varchar(100), > `created` datetime, > `deleted` tinyint(1) > ); > `users` ( > `id` int(11) auto_increment, > `familymember_id` int(11), > `username` varchar(20), > `password` varchar(255), > `deleted` tinyint(1), > `created` datetime > ); > > I'm using a hasOne association in the Familymember model, so it will > only return one record ... great! But now I want to be able to keep > old records, so if a user would be removed Users.deleted will be set > to 1. Also great, so I thought, just fix the association so it will > only return records where Users.deleted = 0. So I did that like this: > > var $hasOne = array( > 'User' => > array( > 'className' => 'User', > 'conditions' => 'User.deleted = 0' > ) > ); > > The CakePHP Manual says the following about hasOne associations: > > "We could use this to tell Cake to only associate a Profile that has a > green header, if we wished. To define conditions like this, you'd > specify a SQL conditions fragment as the value for this key: > "Profile.header_color = 'green'"." -http://manual.cakephp.org/ > chapter/models > > So in my case this model should only associate a Familymember that has > not been deleted. But this simply doesn't work, Cake ignores the > 'conditions'-part alltogether. I even tried to make conditions that > would generate errors ... didn't get an error and none of the > 'conditions' are included in the SQL-query. > > I've googled around to see if anyone else has a similar problem or > similar system explained but haven't had any luck so far. So is there > anyone who can tell me what I'm doing wrong, or even better, tell me > how to do this the right way. > > Thanks! > > By the way: I'm using PHP 4.4 and CakePHP 1.1.14.4797 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Model associations problem
Hello there, I've got a simple construction of two models: users and familymembers; every user belongs to a familymember and a familymember has one user. So the database looks like this: `familymembers` ( `id` int(11) auto_increment, `firstname` varchar(20), `lastname` varchar(100), `gender` tinyint(4), `dob` date, `email` varchar(100), `created` datetime, `deleted` tinyint(1) ); `users` ( `id` int(11) auto_increment, `familymember_id` int(11), `username` varchar(20), `password` varchar(255), `deleted` tinyint(1), `created` datetime ); I'm using a hasOne association in the Familymember model, so it will only return one record ... great! But now I want to be able to keep old records, so if a user would be removed Users.deleted will be set to 1. Also great, so I thought, just fix the association so it will only return records where Users.deleted = 0. So I did that like this: var $hasOne = array( 'User' => array( 'className' => 'User', 'conditions' => 'User.deleted = 0' ) ); The CakePHP Manual says the following about hasOne associations: "We could use this to tell Cake to only associate a Profile that has a green header, if we wished. To define conditions like this, you'd specify a SQL conditions fragment as the value for this key: "Profile.header_color = 'green'"." -http://manual.cakephp.org/ chapter/models So in my case this model should only associate a Familymember that has not been deleted. But this simply doesn't work, Cake ignores the 'conditions'-part alltogether. I even tried to make conditions that would generate errors ... didn't get an error and none of the 'conditions' are included in the SQL-query. I've googled around to see if anyone else has a similar problem or similar system explained but haven't had any luck so far. So is there anyone who can tell me what I'm doing wrong, or even better, tell me how to do this the right way. Thanks! By the way: I'm using PHP 4.4 and CakePHP 1.1.14.4797 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Using AJAX to fill a at page onload.
Goodday everyone, I've got the following controllers and views: /posts/index /posts/view/[postid] /pictures/picturepreview/[photobookid] /pictures/pictures/[photobookid] Now in the /posts/index and /posts/view/[postid] views I've got the following : ... "> ... And now, using AJAX, I simply want to load the /pictures/ picturepreview/ into the div on /posts/ index and load the /pictures/picturepreview/ into the div on /posts/view/. I'd like to use the CakePHP AJAX helper but I can't figure it out, can anyone help me with this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
multiple fields in $displayField.
Hello there, I've been trying to fill a SELECT-tag by using the generateList function, this works great! Although I want to fill it with multiple fields from the table, eg. firstname . ' ' . lastname. How can I pull this off? Greets Ruud --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---