Re: Inflections, scaffold e Cake
Talvez ajude: http://www.tuliofaria.net/inflections-no-cakephp/ On 11 jun, 04:57, Gustavo Carreno [EMAIL PROTECTED] wrote: On 6/11/07, RoadHouse Blues [EMAIL PROTECTED] wrote: eu acho que replicar o esquema de pluralização automática para o português é falho a estrutura da língua é mais complexa que o do inglês o que IMHO seja um overhead nisso Não podia estar mais de acordo contigo, mas se fosse um esforço de uma comunidade, que à medida que fosse precisando fosse construindo o ficheiro a coisa podia avançar passo a passo, pq bem vistas as coisas não precisamos da língua toda mas sim do que mais se usa em termos de aplicações web, né ? -- Gustavo Carreno --- If you know Red Hat you know Red Hat, If you know Slackware you know Linux --~--~-~--~~~---~--~~ Recebeu esta mensagem porque está inscrito em Grupo Cake PHP Português dos Grupos do Google. Para enviar mensagens para este grupo, envie um email para cake-php-pt@googlegroups.com Para anular a inscrição neste grupo, envie um email para [EMAIL PROTECTED] Para mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-PT -~--~~~~--~~--~--~---
Re: Getting js to work - prototype, jquery dont matter
Is there anything on the first 36 lines that may or may not cause an issue or is it all html? I can't see why any of that would be causing issues...what version of PHP is the local and remote hosts? -- http://lemoncake.wordpress.com On Jun 28, 3:35 pm, MercedesAMG [EMAIL PROTECTED] wrote: In the default.ctp i have the following: Line 37?php echo $html-charset('UTF-8');? 38?php echo $javascript-link('prototype'); ? 39?php echo $javascript-link('jQuery'); ? I have in app/app_controller.php the following: class AppController extends Controller { var $helpers = array('Html', 'Link', 'Form', 'Javascript', 'Ajax'); } and I have the same helpers line in every controller, just in case and in fact they were there before I made a new app_controller.php file. I have debug on but the only line showing for an error is the line 38 error. ... but in the upper title of the page it says missing helper Class so i checked that all out. I was able to have the entire application work on localhost and on a test live site. This application is installed on a new production server. Thanks On Jun 27, 10:51 pm, Geoff Ford [EMAIL PROTECTED] wrote: Helpers used in the default.ctp need to be either included in every controller or in the app_controller.php What is the function that it it can't find? i.e. what is on line 38? --http://lemoncake.wordpress.com On Jun 28, 2:15 pm, MercedesAMG [EMAIL PROTECTED] wrote: here is the erro message I get Fatal error: Call to a member function on a non-object in /home/ totalme/public_html/app/views/layouts/default.ctp on line 38 i have helper is controller and scripts are in app/webroot/js tried jquery and then back to prototype same error message I am missing ?- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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: How can I get the execution time of PHP code and DB access?
Oh and to increse performace look into the caching settings in cake Cheers, Geoff -- http://lemoncake.wordpress.com On Jun 28, 4:21 pm, Geoff Ford [EMAIL PROTECTED] wrote: For query times put DEBUG on level 2 in core.php A table will show at the bottom of the page with all your sql queries including a Took (ms) column. For total page execution - on DEBUG level 2 there is a comment rendered in the source with the execution time (right at the bottom) On Jun 28, 3:36 pm, hi and hello [EMAIL PROTECTED] wrote: I am using cakephp to build a website and at last I found the performance is not very well. So I want to know if it exits a tool by which I can get the execution time of PHP code and DB access? Or how can I write the tool ? thanks very much!!! --~--~-~--~~~---~--~~ 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: Getting js to work - prototype, jquery dont matter
When I remove the references to javascript (lines 38 and 39) the pages show up perfectly albiet in html format and no javascript rendering On Jun 28, 12:33 am, MercedesAMG [EMAIL PROTECTED] wrote: localhost is php 5.2.1 trial site was using same php production site is using php 4.4.7 the default.ctp is pretty generic from the cake install I removed anything possibly flaky and still get same error. thanks On Jun 28, 12:04 am, Geoff Ford [EMAIL PROTECTED] wrote: Is there anything on the first 36 lines that may or may not cause an issue or is it all html? I can't see why any of that would be causing issues...what version of PHP is the local and remote hosts? --http://lemoncake.wordpress.com On Jun 28, 3:35 pm, MercedesAMG [EMAIL PROTECTED] wrote: In the default.ctp i have the following: Line 37?php echo $html-charset('UTF-8');? 38?php echo $javascript-link('prototype'); ? 39?php echo $javascript-link('jQuery'); ? I have in app/app_controller.php the following: class AppController extends Controller { var $helpers = array('Html', 'Link', 'Form', 'Javascript', 'Ajax'); } and I have the same helpers line in every controller, just in case and in fact they were there before I made a new app_controller.php file. I have debug on but the only line showing for an error is the line 38 error. ... but in the upper title of the page it says missing helper Class so i checked that all out. I was able to have the entire application work on localhost and on a test live site. This application is installed on a new production server. Thanks On Jun 27, 10:51 pm, Geoff Ford [EMAIL PROTECTED] wrote: Helpers used in the default.ctp need to be either included in every controller or in the app_controller.php What is the function that it it can't find? i.e. what is on line 38? --http://lemoncake.wordpress.com On Jun 28, 2:15 pm, MercedesAMG [EMAIL PROTECTED] wrote: here is the erro message I get Fatal error: Call to a member function on a non-object in /home/ totalme/public_html/app/views/layouts/default.ctp on line 38 i have helper is controller and scripts are in app/webroot/js tried jquery and then back to prototype same error message I am missing ?- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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: validating password
If i use $this-invalidate(password, Passwords do not match); how do i associate that in my view.. Currently my view has ?php echo $form-input('password', array('error' = 'Password must be at least 4 characters.', 'type'='password', 'value' ='')); ? for the password.. If i do as you say, i still get the error about being at least 4 characters.. Personally i'd rather not even have the error messages in the view but in the models.. How do i set the error from invalidate to display in the views? On Jun 27, 4:27 pm, Grant Cox [EMAIL PROTECTED] wrote: I would use $this-invalidate('password', Passwords do not match) - this way it is just the same as any other validation routine. You also don't need to call beforeValidate() in your beforeSave, it is done automatically by Cake when you save. Your beforeSave is still MD5-ing every password that gets put in there. So, if you do: $existing_user = $this-User-read(null, $user_id); $existing_user['User']['name'] = 'I am changing your name'; $this-User-save( $existing_user ); then your password is now double MD5'd. What I was saying previously is that the field submitted from the form that has the plain text password should not be the actual password field used in your database. So if you use password in the database to indicate a hashed password, then on your form make the field plain_password or new_password or something - this way in your beforeSave you know if it needs to be MD5'd, otherwise don't change. The plain_password should not be saved into the db at all. And you're right, the hashed password field should not appear in a form either. --~--~-~--~~~---~--~~ 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: Getting js to work - prototype, jquery dont matter
In your default.ctp do a debug on $this-helpers and/or $this-.viewVars It seems to me that the helpers aren't being passed through to the view object. Html is the only helper by default (cake/libs/view/view.php line 115) which is then supposed to be overwritten by the controllers helper (line 289) which is inside a __construc() which I think is PHP5 only - this is probably the cause of the issue on PHP4. Geoff -- http://lemoncake.wordpress.com On Jun 28, 4:33 pm, MercedesAMG [EMAIL PROTECTED] wrote: localhost is php 5.2.1 trial site was using same php production site is using php 4.4.7 the default.ctp is pretty generic from the cake install I removed anything possibly flaky and still get same error. thanks On Jun 28, 12:04 am, Geoff Ford [EMAIL PROTECTED] wrote: Is there anything on the first 36 lines that may or may not cause an issue or is it all html? I can't see why any of that would be causing issues...what version of PHP is the local and remote hosts? --http://lemoncake.wordpress.com On Jun 28, 3:35 pm, MercedesAMG [EMAIL PROTECTED] wrote: In the default.ctp i have the following: Line 37?php echo $html-charset('UTF-8');? 38?php echo $javascript-link('prototype'); ? 39?php echo $javascript-link('jQuery'); ? I have in app/app_controller.php the following: class AppController extends Controller { var $helpers = array('Html', 'Link', 'Form', 'Javascript', 'Ajax'); } and I have the same helpers line in every controller, just in case and in fact they were there before I made a new app_controller.php file. I have debug on but the only line showing for an error is the line 38 error. ... but in the upper title of the page it says missing helper Class so i checked that all out. I was able to have the entire application work on localhost and on a test live site. This application is installed on a new production server. Thanks On Jun 27, 10:51 pm, Geoff Ford [EMAIL PROTECTED] wrote: Helpers used in the default.ctp need to be either included in every controller or in the app_controller.php What is the function that it it can't find? i.e. what is on line 38? --http://lemoncake.wordpress.com On Jun 28, 2:15 pm, MercedesAMG [EMAIL PROTECTED] wrote: here is the erro message I get Fatal error: Call to a member function on a non-object in /home/ totalme/public_html/app/views/layouts/default.ctp on line 38 i have helper is controller and scripts are in app/webroot/js tried jquery and then back to prototype same error message I am missing ?- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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: checkboxes 1.2
echo $form-checkbox('s_sexes[]',array('value'='Men')) . 'Men'; echo $form-checkbox('s_sexes[]',array('value'='Women')) . 'Women'; might work - you should then get the usual array structure in php $_POST['s_sexes'] = array('Men', 'Women') Geoff -- http://lemoncake.wordpress.com On Jun 28, 2:55 pm, Allen Romero [EMAIL PROTECTED] wrote: radio buttons won't suffice here. Has anyone successfully used checkboxes in 1.2. Surely someone has this working? Thx. Allen On Jun 24, 3:15 pm, trooney [EMAIL PROTECTED] wrote: Try using radio inputs instead ofcheckboxes. echo $html- radio('s_sexes',array('man'='Man','woman'='Woman','both'='Both'); On Jun 24, 4:35 pm, Allen Romero [EMAIL PROTECTED] wrote: Does anyone know how to displaycheckboxesin1.2then retrieve their values I tried something like echo $form-checkbox('s_sexes',array('value'='Men')) . 'Men'; echo $form-checkbox('s_sexes',array('value'='Women')) . 'Women'; but whent he page is submitted, if both are checked, only the second value is submitted to the page. Any examples appreciated. Thx. Allen --~--~-~--~~~---~--~~ 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 line file import problem.
I am attempting to import a file that has been uploaded to a imports folder in the correct location... I have had the import routine saving an entry, but when the next line is imported it does nto create a new record but updates the previous one. How can I do this... // open the file for reading if (! $fd = @fopen($csvFile, r)) { die(Failed to open input file); } // set header to true $header = true; // read the file using the automatic csv conversion routines while ($fields = fgetcsv($fd)) { // if it the header then skip the row if ($header) { /* skip CSV header row */ $header = false; continue; } else { // parse the imported data into the data array ready for saving $this-data = $this-__parse_csv_row($fields); // save the imported user data $this-User-save($this-data); } } Am I barking up the wrong tree on the way -save works? Can I not get it to function this way? Thanks Ady --~--~-~--~~~---~--~~ 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: Getting js to work - prototype, jquery dont matter
Here is a more interesting potential solution: from my webhost: just not sure which .htaccess file to alter ... Do Rochen support both PHP4 and PHP5? Rochen is proud to be one of the very first hosting providers to offer dual PHP platform support meaning we support both PHP4 and PHP5 alongside each other on the same server. This is extremely useful because it means you can run a PHP4 script in one directory and a PHP5 script in another directory of the same account. You can select on the fly the PHP build you wish to use. There is no need to host sites on different servers etc. Some hosts have opted to make a full migration to PHP5 but in our opinion this is an irresponsible thing to do as it results in many popular scripts breaking that are not PHP5 compatible. We do however recognize the need for PHP5 support to allow clients to deploy the latest cutting edge applications in a production environment. Our dual PHP platform support system provides the best of both worlds. There are two very simple ways you can take advantage of PHP5 support under your account - * 1) Simply name the script you wish to execute using PHP5 .php5 instead of .php. That's all you need to do. * 2) Alternatively, if you would like scripts named .php to execute using PHP5 instead of PHP4 then simply drop the following contents into a .htaccess file within the directory containing the PHP5 script - Quote: AddHandler application/x-httpd-php5 .php By default all scripts named .php or .php4 will execute using PHP4 unless you are using the above .htaccess directive and scripts named .php5 will execute using PHP5. We will be keeping PHP4 as the default installation on all servers for the foreseeable future. As PHP5 develops over the next few years though, we may eventually change the configuration so that PHP5 is the default PHP installation. We have deployed the dual PHP support system on all shared (premium and non-premium) servers at no extra cost and it is available for immediate use. This has not been deployed on Managed Dedicated Servers as some clients are running very custom configurations, some are already running PHP5 and others simply don't need this type of support. If you would like dual PHP support though then please open a ticket and we will try and arrange this for you. On Jun 28, 12:50 am, Geoff Ford [EMAIL PROTECTED] wrote: In your default.ctp do a debug on $this-helpers and/or $this-.viewVars It seems to me that the helpers aren't being passed through to the view object. Html is the only helper by default (cake/libs/view/view.php line 115) which is then supposed to be overwritten by the controllers helper (line 289) which is inside a __construc() which I think is PHP5 only - this is probably the cause of the issue on PHP4. Geoff --http://lemoncake.wordpress.com On Jun 28, 4:33 pm, MercedesAMG [EMAIL PROTECTED] wrote: localhost is php 5.2.1 trial site was using same php production site is using php 4.4.7 the default.ctp is pretty generic from the cake install I removed anything possibly flaky and still get same error. thanks On Jun 28, 12:04 am, Geoff Ford [EMAIL PROTECTED] wrote: Is there anything on the first 36 lines that may or may not cause an issue or is it all html? I can't see why any of that would be causing issues...what version of PHP is the local and remote hosts? --http://lemoncake.wordpress.com On Jun 28, 3:35 pm, MercedesAMG [EMAIL PROTECTED] wrote: In the default.ctp i have the following: Line 37?php echo $html-charset('UTF-8');? 38?php echo $javascript-link('prototype'); ? 39?php echo $javascript-link('jQuery'); ? I have in app/app_controller.php the following: class AppController extends Controller { var $helpers = array('Html', 'Link', 'Form', 'Javascript', 'Ajax'); } and I have the same helpers line in every controller, just in case and in fact they were there before I made a new app_controller.php file. I have debug on but the only line showing for an error is the line 38 error. ... but in the upper title of the page it says missing helper Class so i checked that all out. I was able to have the entire application work on localhost and on a test live site. This application is installed on a new production server. Thanks On Jun 27, 10:51 pm, Geoff Ford [EMAIL PROTECTED] wrote: Helpers used in the default.ctp need to be either included in every controller or in the app_controller.php What is the function that it it can't find? i.e. what is on line 38? --http://lemoncake.wordpress.com On Jun 28, 2:15 pm, MercedesAMG [EMAIL PROTECTED] wrote: here is the erro message I get Fatal error: Call to a member function on a non-object in /home/ totalme/public_html/app/views/layouts/default.ctp on line 38 i have helper is controller and scripts are in app/webroot/js tried
Re: Getting js to work - prototype, jquery dont matter
Here is a more interesting potential solution: from my webhost: just not sure which .htaccess file to alter ... Do Rochen support both PHP4 and PHP5? Rochen is proud to be one of the very first hosting providers to offer dual PHP platform support meaning we support both PHP4 and PHP5 alongside each other on the same server. This is extremely useful because it means you can run a PHP4 script in one directory and a PHP5 script in another directory of the same account. You can select on the fly the PHP build you wish to use. There is no need to host sites on different servers etc. Some hosts have opted to make a full migration to PHP5 but in our opinion this is an irresponsible thing to do as it results in many popular scripts breaking that are not PHP5 compatible. We do however recognize the need for PHP5 support to allow clients to deploy the latest cutting edge applications in a production environment. Our dual PHP platform support system provides the best of both worlds. There are two very simple ways you can take advantage of PHP5 support under your account - * 1) Simply name the script you wish to execute using PHP5 .php5 instead of .php. That's all you need to do. * 2) Alternatively, if you would like scripts named .php to execute using PHP5 instead of PHP4 then simply drop the following contents into a .htaccess file within the directory containing the PHP5 script - Quote: AddHandler application/x-httpd-php5 .php By default all scripts named .php or .php4 will execute using PHP4 unless you are using the above .htaccess directive and scripts named .php5 will execute using PHP5. We will be keeping PHP4 as the default installation on all servers for the foreseeable future. As PHP5 develops over the next few years though, we may eventually change the configuration so that PHP5 is the default PHP installation. We have deployed the dual PHP support system on all shared (premium and non-premium) servers at no extra cost and it is available for immediate use. This has not been deployed on Managed Dedicated Servers as some clients are running very custom configurations, some are already running PHP5 and others simply don't need this type of support. If you would like dual PHP support though then please open a ticket and we will try and arrange this for you. On Jun 28, 12:50 am, Geoff Ford [EMAIL PROTECTED] wrote: In your default.ctp do a debug on $this-helpers and/or $this-.viewVars It seems to me that the helpers aren't being passed through to the view object. Html is the only helper by default (cake/libs/view/view.php line 115) which is then supposed to be overwritten by the controllers helper (line 289) which is inside a __construc() which I think is PHP5 only - this is probably the cause of the issue on PHP4. Geoff --http://lemoncake.wordpress.com On Jun 28, 4:33 pm, MercedesAMG [EMAIL PROTECTED] wrote: localhost is php 5.2.1 trial site was using same php production site is using php 4.4.7 the default.ctp is pretty generic from the cake install I removed anything possibly flaky and still get same error. thanks On Jun 28, 12:04 am, Geoff Ford [EMAIL PROTECTED] wrote: Is there anything on the first 36 lines that may or may not cause an issue or is it all html? I can't see why any of that would be causing issues...what version of PHP is the local and remote hosts? --http://lemoncake.wordpress.com On Jun 28, 3:35 pm, MercedesAMG [EMAIL PROTECTED] wrote: In the default.ctp i have the following: Line 37?php echo $html-charset('UTF-8');? 38?php echo $javascript-link('prototype'); ? 39?php echo $javascript-link('jQuery'); ? I have in app/app_controller.php the following: class AppController extends Controller { var $helpers = array('Html', 'Link', 'Form', 'Javascript', 'Ajax'); } and I have the same helpers line in every controller, just in case and in fact they were there before I made a new app_controller.php file. I have debug on but the only line showing for an error is the line 38 error. ... but in the upper title of the page it says missing helper Class so i checked that all out. I was able to have the entire application work on localhost and on a test live site. This application is installed on a new production server. Thanks On Jun 27, 10:51 pm, Geoff Ford [EMAIL PROTECTED] wrote: Helpers used in the default.ctp need to be either included in every controller or in the app_controller.php What is the function that it it can't find? i.e. what is on line 38? --http://lemoncake.wordpress.com On Jun 28, 2:15 pm, MercedesAMG [EMAIL PROTECTED] wrote: here is the erro message I get Fatal error: Call to a member function on a non-object in /home/ totalme/public_html/app/views/layouts/default.ctp on line 38 i have helper is controller and scripts are in app/webroot/js tried
Re: cake1.2 model validation
You shouldn't need to do that. The process is you call Model::save() Model::save calls validates validates calls invalidFields invalidFields iterates the validate array and set validationErrors via invalidate (in your ValidFunc you make a call to invalidate therby also setting validationErrors) invalidFields returns validationErrors to validates validates makes sure that validationErrors count is 0 validates returns false to save wich then returns false to your if ($model-save()) Then all happens as normal :- validationErrors is passed onto view in controller::render (line 639)) as long as the Model is one of the $uses. If you are instatiating the Model yourself it wont forward on the validationErrors Geoff -- http://lemoncake.wordpress.com On Jun 28, 3:22 pm, phpjoy [EMAIL PROTECTED] wrote: works like a charm.. here's the final code: var $validate = array( 'directory' = array('rule' = 'ValidFunc') ); function ValidFunc($value) { $this-data['ModelName']['fieldname']='new' .$value; case 1: $this-invalidate('fieldname', 'message1'); return true; case 2: $this-invalidate('fieldname', 'message2'); return true; } now here's the magic trick, in order to make it visible in the form in the view i should..: $this-data = $this-ModelName-data; otherwise it doesn't get changed in the controller and then displayed in the view. is there a way to change it from the model itself? On Jun 28, 1:05 am, francky06l [EMAIL PROTECTED] wrote: Yes, nice hack somehow :-) Thanks Geoff On Jun 28, 12:56 am, Geoff Ford [EMAIL PROTECTED] wrote: Just took at look at the code and your right franky, after you return false from your custom function invalidFields() then calls $this- invalidate() itself overwriting the message you just wrote. However this is not the case if you return true. This may be a bit wrong but you can get around this like so function ValidFun($ruleParams){ $fieldName = array_keys($ruleParams); $fieldName = $fieldName[0]; if ($conditions){ // all validation passed } else { // validation failed $this-invalidate($fieldName, 'Your Error Message'); } return true; } By always returning true invalidFields() will not set the error message itself, but the Model::validationErrors will still contain the invalid field with your error message and and so Model::validates() will return the correct value of false. On Jun 28, 8:45 am, francky06l [EMAIL PROTECTED] wrote: I am not sure that will work (I might be wrong) but it seems to me that the model-invalidate is called after your validFunc returning false (this call will oerwrite your message). I haven't tested, neither check the code deeply enough to know if the call to invalidate (into the validateField method) checks for an existing messages prior to call invalidate.. Let me know :-) Thanks On Jun 28, 12:30 am, Geoff Ford [EMAIL PROTECTED] wrote: Oops just reread the question. To set the error message from within the ValidFunc you can use the Model::invalidate($field, $value = null); On Jun 28, 8:26 am, Geoff Ford [EMAIL PROTECTED] wrote: if believe that you can change the error message with var $validate = array( 'directory' = array('error_mesasage' = array(array('rule' = 'ValidFunc', 'message'='message')) ); On Jun 28, 5:32 am, francky06l [EMAIL PROTECTED] wrote: I guess you can't do this using the model validation, but if your validation function is in the current model, you could replace the value $this-data['Model']['field'] and return true (in this way, this will not be considered as an error). If your goal is to correct the value, show it with a message, the above is still valid (for the value) but I have no idea how to change the message. You can have a look to the bakery (multiple validation), Mariano has done work about validation messages into the view-side, maybe there you could interact with it. On Jun 27, 9:11 pm, phpjoy [EMAIL PROTECTED] wrote: ahoy, i have the following validation in a model: var $validate = array( 'directory' = array('rule' = 'ValidFunc', 'message'='message') ); function ValidFunc($value) { $newvalue = 'new' .$value; $value = $newvalue; case 1: /*message=1*/ return false; case 2: /*message=2*/ return false; } there are 2 things i'm struggling to do: 1) change the validation message from the ValidFunc, 2) change $value for the form to $newvalue. anyone knows how i can do that? --~--~-~--~~~---~--~~ You received this message
Re: How can I get the execution time of PHP code and DB access?
Thank you, but there still exists a problem . Because I use AJAX in my website and return the data as JSON format, so I can not let cakephp append the debug infor to the response. And I want to read the the infor at a console or a log file? Can I do it? On 6月28日, 下午2时21分, Geoff Ford [EMAIL PROTECTED] wrote: For query times put DEBUG on level 2 in core.php A table will show at the bottom of the page with all your sql queries including a Took (ms) column. For total page execution - on DEBUG level 2 there is a comment rendered in the source with the execution time (right at the bottom) On Jun 28, 3:36 pm, hi and hello [EMAIL PROTECTED] wrote: I am using cakephp to build a website and at last I found the performance is not very well. So I want to know if it exits a tool by which I can get the execution time of PHP code and DB access? Or how can I write the tool ? thanks very much!!!- 隐藏被引用文字 - - 显示引用的文字 - --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Extending / Decorating models and views
Hi, I am developing an application to content manage a group of food menus - Breakfast, Lunch, Dinner, Wine Each menu is divided into Groups - Sandwiches, Soup, Dessert, etc. Each Group has a number of Dishes - Ham Sandwich, Cheese Sandwich. When viewing a menu, the controller will read these recursively and the view will show Groups Dishes for that. Now Dishes in our Wine menu have extra columns, price per 1/2 bottle, tasting notes, etc. as well as the same information as our normal dishes. I would like to use the same controller to read write the Wine menu and normal menus, so I my thinking is to decorate my MenuDish model with a WineDrink one rather than extend it - my WineDrink model belongs to my MenuDish and MenuDish hasOne I would also like to use the same view to display MenuDishes and WineDrinks - would the best way be to conditionally use an element? I am a little stuck as to the best way to approach this without writing a lot of duplicated functionality in my code and how to do the decoration, particularly when saving a new MenuDish / WineDrink item. Does anyone have any recommendations or thoughts. Thanks Ski --~--~-~--~~~---~--~~ 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: Getting js to work - prototype, jquery dont matter
Depends on what you have uploaded to the server. If app, cake and vendors at at the site root level you shoudl do the .htaccess there and it *should* work for all subdirectories. Else edit the one in webroot - or both... On Jun 28, 5:03 pm, MercedesAMG [EMAIL PROTECTED] wrote: Here is a more interesting potential solution: from my webhost: just not sure which .htaccess file to alter ... Do Rochen support both PHP4 and PHP5? Rochen is proud to be one of the very first hosting providers to offer dual PHP platform support meaning we support both PHP4 and PHP5 alongside each other on the same server. This is extremely useful because it means you can run a PHP4 script in one directory and a PHP5 script in another directory of the same account. You can select on the fly the PHP build you wish to use. There is no need to host sites on different servers etc. Some hosts have opted to make a full migration to PHP5 but in our opinion this is an irresponsible thing to do as it results in many popular scripts breaking that are not PHP5 compatible. We do however recognize the need for PHP5 support to allow clients to deploy the latest cutting edge applications in a production environment. Our dual PHP platform support system provides the best of both worlds. There are two very simple ways you can take advantage of PHP5 support under your account - * 1) Simply name the script you wish to execute using PHP5 .php5 instead of .php. That's all you need to do. * 2) Alternatively, if you would like scripts named .php to execute using PHP5 instead of PHP4 then simply drop the following contents into a .htaccess file within the directory containing the PHP5 script - Quote: AddHandler application/x-httpd-php5 .php By default all scripts named .php or .php4 will execute using PHP4 unless you are using the above .htaccess directive and scripts named .php5 will execute using PHP5. We will be keeping PHP4 as the default installation on all servers for the foreseeable future. As PHP5 develops over the next few years though, we may eventually change the configuration so that PHP5 is the default PHP installation. We have deployed the dual PHP support system on all shared (premium and non-premium) servers at no extra cost and it is available for immediate use. This has not been deployed on Managed Dedicated Servers as some clients are running very custom configurations, some are already running PHP5 and others simply don't need this type of support. If you would like dual PHP support though then please open a ticket and we will try and arrange this for you. On Jun 28, 12:50 am, Geoff Ford [EMAIL PROTECTED] wrote: In your default.ctp do a debug on $this-helpers and/or $this-.viewVars It seems to me that the helpers aren't being passed through to the view object. Html is the only helper by default (cake/libs/view/view.php line 115) which is then supposed to be overwritten by the controllers helper (line 289) which is inside a __construc() which I think is PHP5 only - this is probably the cause of the issue on PHP4. Geoff --http://lemoncake.wordpress.com On Jun 28, 4:33 pm, MercedesAMG [EMAIL PROTECTED] wrote: localhost is php 5.2.1 trial site was using same php production site is using php 4.4.7 the default.ctp is pretty generic from the cake install I removed anything possibly flaky and still get same error. thanks On Jun 28, 12:04 am, Geoff Ford [EMAIL PROTECTED] wrote: Is there anything on the first 36 lines that may or may not cause an issue or is it all html? I can't see why any of that would be causing issues...what version of PHP is the local and remote hosts? --http://lemoncake.wordpress.com On Jun 28, 3:35 pm, MercedesAMG [EMAIL PROTECTED] wrote: In the default.ctp i have the following: Line 37?php echo $html-charset('UTF-8');? 38?php echo $javascript-link('prototype'); ? 39?php echo $javascript-link('jQuery'); ? I have in app/app_controller.php the following: class AppController extends Controller { var $helpers = array('Html', 'Link', 'Form', 'Javascript', 'Ajax'); } and I have the same helpers line in every controller, just in case and in fact they were there before I made a new app_controller.php file. I have debug on but the only line showing for an error is the line 38 error. ... but in the upper title of the page it says missing helper Class so i checked that all out. I was able to have the entire application work on localhost and on a test live site. This application is installed on a new production server. Thanks On Jun 27, 10:51 pm, Geoff Ford [EMAIL PROTECTED] wrote: Helpers used in the default.ctp need to be either included in every controller or in the app_controller.php What is the function that it it can't find? i.e. what is on
Re: cakephp rendering
No, as mentioned if you just have the RequestHandler component included in your controller, it will use the Ajax layout when you make an ajax call. The problem is that Michael is not making an ajax call - he is simply calling render() from the view file - which of course is still php and server side. 1. You can't call render() from a view - it is for controllers only. If you want to include a common view chunk, use renderElement. 2. If you want the result of a cake action to be included in your page dynamically (ie via ajax), then use either the Ajax helper to add a request, or write some javascript to do so. --~--~-~--~~~---~--~~ 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: Getting js to work - prototype, jquery dont matter
OK I changed the .htaccess file in the root and now the debug error messages show up and the missing helper is the linkhelper so I added a file in app/views/helpers/link.php with the following: ?php class LinkHelper extends Helper { } ? and guess what it worked. I'll probably keep adding .htaccess files with Add Handler as opposed to changing to .php5 On Jun 28, 12:59 am, MercedesAMG [EMAIL PROTECTED] wrote: Here is a more interesting potential solution: from my webhost: just not sure which .htaccess file to alter ... Do Rochen support both PHP4 and PHP5? Rochen is proud to be one of the very first hosting providers to offer dual PHP platform support meaning we support both PHP4 and PHP5 alongside each other on the same server. This is extremely useful because it means you can run a PHP4 script in one directory and a PHP5 script in another directory of the same account. You can select on the fly the PHP build you wish to use. There is no need to host sites on different servers etc. Some hosts have opted to make a full migration to PHP5 but in our opinion this is an irresponsible thing to do as it results in many popular scripts breaking that are not PHP5 compatible. We do however recognize the need for PHP5 support to allow clients to deploy the latest cutting edge applications in a production environment. Our dual PHP platform support system provides the best of both worlds. There are two very simple ways you can take advantage of PHP5 support under your account - * 1) Simply name the script you wish to execute using PHP5 .php5 instead of .php. That's all you need to do. * 2) Alternatively, if you would like scripts named .php to execute using PHP5 instead of PHP4 then simply drop the following contents into a .htaccess file within the directory containing the PHP5 script - Quote: AddHandler application/x-httpd-php5 .php By default all scripts named .php or .php4 will execute using PHP4 unless you are using the above .htaccess directive and scripts named .php5 will execute using PHP5. We will be keeping PHP4 as the default installation on all servers for the foreseeable future. As PHP5 develops over the next few years though, we may eventually change the configuration so that PHP5 is the default PHP installation. We have deployed the dual PHP support system on all shared (premium and non-premium) servers at no extra cost and it is available for immediate use. This has not been deployed on Managed Dedicated Servers as some clients are running very custom configurations, some are already running PHP5 and others simply don't need this type of support. If you would like dual PHP support though then please open a ticket and we will try and arrange this for you. On Jun 28, 12:50 am, Geoff Ford [EMAIL PROTECTED] wrote: In your default.ctp do a debug on $this-helpers and/or $this-.viewVars It seems to me that the helpers aren't being passed through to the view object. Html is the only helper by default (cake/libs/view/view.php line 115) which is then supposed to be overwritten by the controllers helper (line 289) which is inside a __construc() which I think is PHP5 only - this is probably the cause of the issue on PHP4. Geoff --http://lemoncake.wordpress.com On Jun 28, 4:33 pm, MercedesAMG [EMAIL PROTECTED] wrote: localhost is php 5.2.1 trial site was using same php production site is using php 4.4.7 the default.ctp is pretty generic from the cake install I removed anything possibly flaky and still get same error. thanks On Jun 28, 12:04 am, Geoff Ford [EMAIL PROTECTED] wrote: Is there anything on the first 36 lines that may or may not cause an issue or is it all html? I can't see why any of that would be causing issues...what version of PHP is the local and remote hosts? --http://lemoncake.wordpress.com On Jun 28, 3:35 pm, MercedesAMG [EMAIL PROTECTED] wrote: In the default.ctp i have the following: Line 37?php echo $html-charset('UTF-8');? 38?php echo $javascript-link('prototype'); ? 39?php echo $javascript-link('jQuery'); ? I have in app/app_controller.php the following: class AppController extends Controller { var $helpers = array('Html', 'Link', 'Form', 'Javascript', 'Ajax'); } and I have the same helpers line in every controller, just in case and in fact they were there before I made a new app_controller.php file. I have debug on but the only line showing for an error is the line 38 error. ... but in the upper title of the page it says missing helper Class so i checked that all out. I was able to have the entire application work on localhost and on a test live site. This application is installed on a new production server. Thanks On Jun 27, 10:51 pm, Geoff Ford [EMAIL PROTECTED] wrote: Helpers used in the default.ctp need to be
Help wanted with .htaccess and mod_rewrite
Hello, I have a rather unconventional Cake setup, and since I'm not an .htaccess and mod_rewrite expert, I'm looking for some help these issues. This is my situation: /app - Main site app folder /cake /sub /app - sub site app folder /cake /forum - non-Cake forum So I have 2 Cake projects, each with it's one Cake core. (Yes, it's possible to drive to applications with the same core, but let's say I have my reasons not to do this.) The .htaccess in /app (main site) looks like this: IfModule mod_rewrite.c RewriteEngine on RewriteCond $1 ^(sub) RewriteRule^$ app/webroot/[L] RewriteRule(.*) app/webroot/$1 [L] /IfModule If I understand it correctly, then the line 'RewriteCond $1 ^(sub)' tell the mod_rewrite module to skip the rules if the requested URL starts with 'sub'. I have two problems: 1. The URL http://www.domain.com/sub/ shows the sub site, which is OK. However, when I omit the trailing slash (http://www.domain.com/sub), it doesn't work, and the main site loads up. How do I change the RewriteCond? 2. You'll notice that I have a forum in /sub/forum. This will contain a 'standalone' forum. It will not use Cake. Which .htaccess file do I modify, and how, in order to let http://www.domain.com/sub/forum point to that directory? I've tried this in /sub/.htaccess: IfModule mod_rewrite.c RewriteEngine on RewriteCond $1 ^(sub/forum) RewriteBase /sub RewriteRule^$ app/webroot/[L] RewriteRule(.*) app/webroot/$1 [L] /IfModule But that doesn't work. Any pointers? --~--~-~--~~~---~--~~ 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: Getting js to work - prototype, jquery dont matter
Oh And Thank You for your help most important On Jun 28, 1:37 am, MercedesAMG [EMAIL PROTECTED] wrote: OK I changed the .htaccess file in the root and now the debug error messages show up and the missing helper is the linkhelper so I added a file in app/views/helpers/link.php with the following: ?php class LinkHelper extends Helper { } ? and guess what it worked. I'll probably keep adding .htaccess files with Add Handler as opposed to changing to .php5 On Jun 28, 12:59 am, MercedesAMG [EMAIL PROTECTED] wrote: Here is a more interesting potential solution: from my webhost: just not sure which .htaccess file to alter ... Do Rochen support both PHP4 and PHP5? Rochen is proud to be one of the very first hosting providers to offer dual PHP platform support meaning we support both PHP4 and PHP5 alongside each other on the same server. This is extremely useful because it means you can run a PHP4 script in one directory and a PHP5 script in another directory of the same account. You can select on the fly the PHP build you wish to use. There is no need to host sites on different servers etc. Some hosts have opted to make a full migration to PHP5 but in our opinion this is an irresponsible thing to do as it results in many popular scripts breaking that are not PHP5 compatible. We do however recognize the need for PHP5 support to allow clients to deploy the latest cutting edge applications in a production environment. Our dual PHP platform support system provides the best of both worlds. There are two very simple ways you can take advantage of PHP5 support under your account - * 1) Simply name the script you wish to execute using PHP5 .php5 instead of .php. That's all you need to do. * 2) Alternatively, if you would like scripts named .php to execute using PHP5 instead of PHP4 then simply drop the following contents into a .htaccess file within the directory containing the PHP5 script - Quote: AddHandler application/x-httpd-php5 .php By default all scripts named .php or .php4 will execute using PHP4 unless you are using the above .htaccess directive and scripts named .php5 will execute using PHP5. We will be keeping PHP4 as the default installation on all servers for the foreseeable future. As PHP5 develops over the next few years though, we may eventually change the configuration so that PHP5 is the default PHP installation. We have deployed the dual PHP support system on all shared (premium and non-premium) servers at no extra cost and it is available for immediate use. This has not been deployed on Managed Dedicated Servers as some clients are running very custom configurations, some are already running PHP5 and others simply don't need this type of support. If you would like dual PHP support though then please open a ticket and we will try and arrange this for you. On Jun 28, 12:50 am, Geoff Ford [EMAIL PROTECTED] wrote: In your default.ctp do a debug on $this-helpers and/or $this-.viewVars It seems to me that the helpers aren't being passed through to the view object. Html is the only helper by default (cake/libs/view/view.php line 115) which is then supposed to be overwritten by the controllers helper (line 289) which is inside a __construc() which I think is PHP5 only - this is probably the cause of the issue on PHP4. Geoff --http://lemoncake.wordpress.com On Jun 28, 4:33 pm, MercedesAMG [EMAIL PROTECTED] wrote: localhost is php 5.2.1 trial site was using same php production site is using php 4.4.7 the default.ctp is pretty generic from the cake install I removed anything possibly flaky and still get same error. thanks On Jun 28, 12:04 am, Geoff Ford [EMAIL PROTECTED] wrote: Is there anything on the first 36 lines that may or may not cause an issue or is it all html? I can't see why any of that would be causing issues...what version of PHP is the local and remote hosts? --http://lemoncake.wordpress.com On Jun 28, 3:35 pm, MercedesAMG [EMAIL PROTECTED] wrote: In the default.ctp i have the following: Line 37?php echo $html-charset('UTF-8');? 38?php echo $javascript-link('prototype'); ? 39?php echo $javascript-link('jQuery'); ? I have in app/app_controller.php the following: class AppController extends Controller { var $helpers = array('Html', 'Link', 'Form', 'Javascript', 'Ajax'); } and I have the same helpers line in every controller, just in case and in fact they were there before I made a new app_controller.php file. I have debug on but the only line showing for an error is the line 38 error. ... but in the upper title of the page it says missing helper Class so i checked that all out. I was able to have the entire application work on localhost and on
Re: Incorrectly Nested Arrays
Grant, Excellent - thats an awesome reply. I wont spend the next 2 days trying to get it to do it my way then :-) ha ha Thanks so much. Dan --~--~-~--~~~---~--~~ 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: multiple line file import problem.
Add befrore save $this-User-create(); // save the imported user data $this-User-save($this-data); On Jun 28, 8:56 am, Gould, Adrian [EMAIL PROTECTED] wrote: I am attempting to import a file that has been uploaded to a imports folder in the correct location... I have had the import routine saving an entry, but when the next line is imported it does nto create a new record but updates the previous one. How can I do this... // open the file for reading if (! $fd = @fopen($csvFile, r)) { die(Failed to open input file); } // set header to true $header = true; // read the file using the automatic csv conversion routines while ($fields = fgetcsv($fd)) { // if it the header then skip the row if ($header) { /* skip CSV header row */ $header = false; continue; } else { // parse the imported data into the data array ready for saving $this-data = $this-__parse_csv_row($fields); // save the imported user data $this-User-save($this-data); } } Am I barking up the wrong tree on the way -save works? Can I not get it to function this way? Thanks Ady --~--~-~--~~~---~--~~ 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: How can I get the execution time of PHP code and DB access?
If you want to leverage what is already in cake you will need to modify some core files. In cake/libs/model/datasources/dbo_source.php in function execute() (around lines 277-280) you can manually log the query and time ($this- took) to a log file. Same in app/webroot/index.php for total execution time On Jun 28, 5:10 pm, hi and hello [EMAIL PROTECTED] wrote: Thank you, but there still exists a problem . Because I use AJAX in my website and return the data as JSON format, so I can not let cakephp append the debug infor to the response. And I want to read the the infor at a console or a log file? Can I do it? On 6月28日, 下午2时21分, Geoff Ford [EMAIL PROTECTED] wrote: For query times put DEBUG on level 2 in core.php A table will show at the bottom of the page with all your sql queries including a Took (ms) column. For total page execution - on DEBUG level 2 there is a comment rendered in the source with the execution time (right at the bottom) On Jun 28, 3:36 pm, hi and hello [EMAIL PROTECTED] wrote: I am using cakephp to build a website and at last I found the performance is not very well. So I want to know if it exits a tool by which I can get the execution time of PHP code and DB access? Or how can I write the tool ? thanks very much!!!- 隐藏被引用文字 - - 显示引用的文字 - --~--~-~--~~~---~--~~ 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: Hidden field update using Ajax
Quick solution?: Take a look at the $options array, esp. the $options['complete'] , put in js code to be called when the ajax call is complete. You can then do what ever you like with the results and still update the div. Other than that, I haven't found any other way. Let's know how it goes. Cheers [EMAIL PROTECTED] wrote: Hello guys, I'm new on Ajax, actually I'm developing my first project using it via cake's ajax helper ... that's why I'm little confused on how to implement this functionality: I have a form which ask for a date, once you select a date it has an observeField for an input field which shows me in a div how many events I have for selected date. This is already done, now I want to pass to a hidden tag the id of the selected date once you choose one date, how can I update a div and a hidden tag at the same time? I hope you can help me ... --~--~-~--~~~---~--~~ 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: multiple line file import problem.
Just to explain this a bit more: The way $this-User-save() works depends on whether it can find an id. It first looks at $this-data['User']['id'], if that is empty it then looks at $this-User-id and then if that is empty as well it will insert rather than update. This is fine but the catch comes after the save. After a model is inserted the last insert id is automatically assigned to $this-User-id, therefore any successive calls to $this-User- save() will find $model-id and update the record with that id. Calling $this-User-create() tell the User model that you want to create a new entry and clears $this-User-id Hope that clears up _why_ your problem was happening. Geoff -- http://lemoncake.wordpress.com On Jun 28, 6:41 pm, majna [EMAIL PROTECTED] wrote: Add befrore save $this-User-create(); // save the imported user data $this-User-save($this-data); On Jun 28, 8:56 am, Gould, Adrian [EMAIL PROTECTED] wrote: I am attempting to import a file that has been uploaded to a imports folder in the correct location... I have had the import routine saving an entry, but when the next line is imported it does nto create a new record but updates the previous one. How can I do this... // open the file for reading if (! $fd = @fopen($csvFile, r)) { die(Failed to open input file); } // set header to true $header = true; // read the file using the automatic csv conversion routines while ($fields = fgetcsv($fd)) { // if it the header then skip the row if ($header) { /* skip CSV header row */ $header = false; continue; } else { // parse the imported data into the data array ready for saving $this-data = $this-__parse_csv_row($fields); // save the imported user data $this-User-save($this-data); } } Am I barking up the wrong tree on the way -save works? Can I not get it to function this way? Thanks Ady --~--~-~--~~~---~--~~ 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: multiple line file import problem.
Thanks Geoff - yes it does, but still struggling to get it to save the data. The query generated is: INSERT INTO `users` (`created`,`modified`) VALUES ('2007-06-28 18:33:46','2007-06-28 18:33:46') $people = $this-__convert_csv($uploadfile); foreach( $people as $person) { $this-User-create(); foreach( $person as $dataKey=$dataItem) { $this-details['User'][$dataKey]= $dataItem; } // end foreach echo 'pre style=text-align:left'; print_r($this-details);echo br /; echo /pre; if($this-User-save()) { $this-Session-setFlash('The User has been saved'); } else { $this-Session-setFlash('Please correct errors below.'); } the $this-details contains: Array ( [User] = Array ( [student_id] = 1234567890 [staff_id] = [role_id] = 1 [given_names] = John [last_name] = Doe [preferred_name] = John [username] = DoeJ [passwd] = gfdgJF8 [passwd_encrypted] = f7fd264e428a7f56edc94b6b71cbc5b5 [locked_out] = 0 [attempts] = 0 [campus_id] = 1 [current_year] = 2007 [current_semester] = 1 [directory] = ) ) This successflly inserts a blank row for each row of the data int eh file... if I put if($this-User-save($this-details)) { the result is an 'please correct the errors below'. GRumbles! --~--~-~--~~~---~--~~ 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: multiple line file import problem.
Thanks Maj... -Original Message- From: cake-php@googlegroups.com on behalf of majna Sent: Thu 6/28/2007 16:41 To: Cake PHP Subject: Re: multiple line file import problem. Add befrore save $this-User-create(); // save the imported user data $this-User-save($this-data); On Jun 28, 8:56 am, Gould, Adrian [EMAIL PROTECTED] wrote: I am attempting to import a file that has been uploaded to a imports folder in the correct location... I have had the import routine saving an entry, but when the next line is imported it does nto create a new record but updates the previous one. How can I do this... // open the file for reading if (! $fd = @fopen($csvFile, r)) { die(Failed to open input file); } // set header to true $header = true; // read the file using the automatic csv conversion routines while ($fields = fgetcsv($fd)) { // if it the header then skip the row if ($header) { /* skip CSV header row */ $header = false; continue; } else { // parse the imported data into the data array ready for saving $this-data = $this-__parse_csv_row($fields); // save the imported user data $this-User-save($this-data); } } Am I barking up the wrong tree on the way -save works? Can I not get it to function this way? Thanks Ady --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Safari 3 and Firefox do not understand the urls my cake app is generating...
Hi, Safari 3 (Pc) and Firefox (Mac) do not understand the urls my cake app is generating... Other browsers Safari 2 (Mac), lynx can view the app without problems. /people/index Currently generates 404 errors stating: Not found The requested address index was not found on this server. I am using cake 1.1.13.4450 Can someone confirm this behavior and how can I fix this? Thanks! RLR --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
trouble in Notice: Undefined index:
hello All i'm newbie in cake world =), i've trouble when i learn some tutorial from ibm (cook up web fast using cakephp part2) /--template-- (index.thtml)/ pHello,?e($User)['first_name'].''.$User['last_name'])?/p pyour last login was on ?e($last_login)? ?echo $html-link('knownusers','/users/knownusers')??echo $html-link('logout','users/logout')? /-- in mine controller--(users_controller.php)/ function login() { $this-set('error',false); if($this-data) { $results=$this-User-findByUsername($this-data['User']['username']); if($results $results['User']['password']==md5($this-data['User']['password'])) { $this-Session-write('user',$this-data['User']['username']); $this-Session-write('last_login',$results['user']['last_login']); $results['User']['last_login'] = date(Y-m-d H:i:s); $this-User-save($results); $this-redirect('/users/index'); }else { $this-set('error',true); } } } function index() { $username=$this-Session-read('user'); if($username) { $username=$this-User-findByUsername($username); $this-set('User',$results['User']); $this-set('last_login',$this-Session-read('last_login')); }else{ $this-redirect('/users/login'); } } the trouble is when i execute,i've got error message like this; Notice: Undefined index: User in C:\xampp\htdocs\kerjaan\cake\latianbake\controllers\users_controller.php on line 43 line 43 is in function login anyone can help me please ? thx before =) -- -yprs- --~--~-~--~~~---~--~~ 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: How can I get the execution time of PHP code and DB access?
Another solution which would not require any alteration to Cake would be to install the xdebug module to php and use it's profiling capabilities. This will generate a lot more info than you need, but will let you know where all the bottlenecks in your app are down to the line of code level. Simon On 28 Jun, 10:04, Geoff Ford [EMAIL PROTECTED] wrote: If you want to leverage what is already in cake you will need to modify some core files. In cake/libs/model/datasources/dbo_source.php in function execute() (around lines 277-280) you can manually log the query and time ($this- took) to a log file. Same in app/webroot/index.php for total execution time On Jun 28, 5:10 pm, hi and hello [EMAIL PROTECTED] wrote: Thank you, but there still exists a problem . Because I use AJAX in my website and return the data as JSON format, so I can not let cakephp append the debug infor to the response. And I want to read the the infor at a console or a log file? Can I do it? On 6月28日, 下午2时21分, Geoff Ford [EMAIL PROTECTED] wrote: For query times put DEBUG on level 2 in core.php A table will show at the bottom of the page with all your sql queries including a Took (ms) column. For total page execution - on DEBUG level 2 there is a comment rendered in the source with the execution time (right at the bottom) On Jun 28, 3:36 pm, hi and hello [EMAIL PROTECTED] wrote: I am using cakephp to build a website and at last I found the performance is not very well. So I want to know if it exits a tool by which I can get the execution time of PHP code and DB access? Or how can I write the tool ? thanks very much!!!- 隐藏被引用文字 - - 显示引用的文字 - --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Cake 12 validation
Hello, I am working on validation in 1.2 and I discovered some strange behaviors. It could be my fault not using it the correct way. This is mainly when using required and allowEmpty key words, this is some cases I have noticed : $validate = array('name' = array('required' = true)); Will produce a warning about a preg match (because the required actually disppeared and the merging to $validator generated a rule 'blank') $validate = array('name' = array(array('required' = true)));// why twice the array - to eliminate the warning (preg_match) ? Will eliminate the above warning, but since the check is done with 'blank', you always get 'This field can't be left blank' as error. Actually the same using the keyword 'allowEmpty' when used alone. Now such a rule also fails (removing required is ok): $validate = array('name' = array('required' = true, 'rule' = 'alphaNumeric')); Well I can find workaround, but I wanted to replace the VALID_NOT_EMPTY by the cake12 features etc .. I also noticed the keyword 'last' and 'on', For 'on' actually quite good because it can be chekd against 'create' and 'update' . Would be perfect to have another keyword to check on the current action, ie : 'oncurrent' and we could set such rule 'oncurrent' = 'admin_edit' etc .. The 'last' is not implemented yet I think. Though might be useful for others. Franck --~--~-~--~~~---~--~~ 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 associations between same models
Hi all, Is it possible to associate two models twice using hasOne ? E.g. A Message model is associated with a User model twice. Once for the sender and once for the receiver. Both are roles of a user. Ciao, Romano --~--~-~--~~~---~--~~ 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: Multiple associations between same models
On 6/28/07, Romano [EMAIL PROTECTED] wrote: Hi all, Is it possible to associate two models twice using hasOne ? E.g. A Message model is associated with a User model twice. Once for the sender and once for the receiver. Both are roles of a user. yes var $hasOne = array('Sender'=array('className'='User', 'foreignKey'='sender_id'), 'Receiver'=array('className'='User', 'foreignKey'='receiver_id')); hth jon -- jon bennett t: +44 (0) 1225 341 039 w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ 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: How can I have an action return the contents of a processed .thtml file
Hey Geoff, Thanks alot. That should work. On Jun 27, 11:52 pm, Geoff Ford [EMAIL PROTECTED] wrote: http://php.net/ob_starthttp://php.net/ob_get_contents $layout = $this-layout; ob_start(); $this-layout = null; $this-render('view'); $html = ob_get_contents(); ob_end_clean(); $this-layout = $layout; On Jun 28, 12:14 pm, codecowboy [EMAIL PROTECTED] wrote: Hi All, I have been wondering it is possible to have a function like render return as a string the html that is produced by a view after cake has processed it into html. For instance. Lets say that I am using a datagrid to return search results. I use a callback function to modify the content of certain cells. I want that callback function to use a .thtml to stylize the content of the cell. Basically, I am trying to follow MVC design pretty strictly. I do not want to create html in the call back function itself. Perhaps something like this is what I am looking for function printLink(...){ . . . //set some vars for some_view.thtml . . . // Process the view and retrieve the html that resulted $strHtml = $this-render(some_view.thtml); return $strHtml; } I want the html that is returned by printLink(...) to be displayed in the datagrid cell. So my question is Is there anything like that $this-render(some_view.thtml) that I can call in Cake?. Let me know if my question is unclear. --~--~-~--~~~---~--~~ 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: Cake 12 validation
On 6/28/07, francky06l [EMAIL PROTECTED] wrote: Hello, I am working on validation in 1.2 and I discovered some strange behaviors. I would really like for someone to post their real world working 1.2validation model using a varied mix of the capabilities. I've read most of the docs but still don't have a clear picture. I'm sure an actual example would be useful, and I would hazard a guess most of us could work out what we need to know from that and better exploit the feature. I'm sure I can do better than valid_not_empty :-) HG --~--~-~--~~~---~--~~ 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: Cake 12 validation
Where to load such experimentation ? The problem is that, sometimes, the failure are due to a misunderstanding of parameters etc On the above example, using required with alphanumeric does not work (for me) .. I am not good at documentation (also my English is not that good), but I could throw some lines somewhere. Thanks On Jun 28, 2:21 pm, Howard Glynn [EMAIL PROTECTED] wrote: On 6/28/07, francky06l [EMAIL PROTECTED] wrote: Hello, I am working on validation in 1.2 and I discovered some strange behaviors. I would really like for someone to post their real world working 1.2validation model using a varied mix of the capabilities. I've read most of the docs but still don't have a clear picture. I'm sure an actual example would be useful, and I would hazard a guess most of us could work out what we need to know from that and better exploit the feature. I'm sure I can do better than valid_not_empty :-) HG --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Cake 1.2alpha path question
I have this file in my cake 1.2alpha /home/groups/c/co/coaddons/htdocs/caketest/app/views/pages/hello.thtml But I got this error when try to access my hello page using this url http://coaddons.sourceforge.net/caketest/pages/hello An error has been encountered in accessing this page 1. Server: coaddons.sourceforge.net 2. URL path: /caketest/pages/hello. 3. Error notes: File does not exist: /home/groups/c/co/coaddons/htdocs/ caketest/pages/hello. 4. Error type: 404 5. Request method: GET 6. Request query string: 7. Time: 2007-06-28 06:15:18 PDT (1183036518) Note the 1st line is the physical location of the file and the 2nd is access from url with the error. /home/groups/c/co/coaddons/htdocs/caketest/app/views/pages/hello.thtml /home/groups/c/co/coaddons/htdocs/caketest/pages/hello My question is why Cake 1.2alpha can't find the file. Am I missing something real simple here! Thanks --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Please oh please, at my witt's end. [Sessions]
I have cake implemented for one shopping cart and everything seems fine. Client wanted to just copy those files and build a new front-end for the second site. I have copied the files (especially the controllers) multiple times and I have changed all occurrences of the previous site's url. My problem, is that it seems, that new sessions are being created for no reason. Most of the time the application behaves as it should. This is why it is so confusing. My database stores orders by the session id until the user logs in and then the programming sets the session to null and enters a customer id. In my order controller I have this as a beforeFilter() function beforeFilter() { parent::beforeFilter(); $this-session = $this-Session-read('Config.rand'); } Here are the 3 areas where I see session-related problems (note: only on the second site, the first site seems to function fine all the time): 1. On the cart page there is an option of resetting the type of shipping. If you use the drop-down to select something other than the default shipping and click a button update cart, SOMETIMES a new session is created and is updated in the db but then in the code where is looks and compares session it no longer equates since it has been changed. 2. After cart, before 1st checkout page, user is required to login or create account. Session changes so when user logs in customer id is not saved since sessions do not match 3. Every refresh of the page creates a new session WTF? Please if you could offer ANY ideas, I have eaten and spent of 20 hours trying to debug this problem... Thank you ever s much. --~--~-~--~~~---~--~~ 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: Please oh please, at my witt's end. [Sessions]
Are both installations on the same server? If so, are they both installed under the same user account? On 6/28/07, kerkor [EMAIL PROTECTED] wrote: I have cake implemented for one shopping cart and everything seems fine. Client wanted to just copy those files and build a new front-end for the second site. I have copied the files (especially the controllers) multiple times and I have changed all occurrences of the previous site's url. My problem, is that it seems, that new sessions are being created for no reason. Most of the time the application behaves as it should. This is why it is so confusing. My database stores orders by the session id until the user logs in and then the programming sets the session to null and enters a customer id. In my order controller I have this as a beforeFilter() function beforeFilter() { parent::beforeFilter(); $this-session = $this-Session-read('Config.rand'); } Here are the 3 areas where I see session-related problems (note: only on the second site, the first site seems to function fine all the time): 1. On the cart page there is an option of resetting the type of shipping. If you use the drop-down to select something other than the default shipping and click a button update cart, SOMETIMES a new session is created and is updated in the db but then in the code where is looks and compares session it no longer equates since it has been changed. 2. After cart, before 1st checkout page, user is required to login or create account. Session changes so when user logs in customer id is not saved since sessions do not match 3. Every refresh of the page creates a new session WTF? Please if you could offer ANY ideas, I have eaten and spent of 20 hours trying to debug this problem... Thank you ever s much. --~--~-~--~~~---~--~~ 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: Cake 12 validation
The biggest issue is that the validation class is not finished. May of the options and items within the class are placeholders or never get called I've decided that improving the validation class should be my next project...so I'm going to see what I can do over the next week. --~--~-~--~~~---~--~~ 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: Cake 12 validation
Ohin the meantime, read this: http://cakebaker.42dh.com/2007/01/03/validation-with-cakephp-12/ --~--~-~--~~~---~--~~ 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: Admin Routes. Your advice?
Look at the manual (http://manual.cakephp.org/chapter/configuration) section 4. Read the first three paragraphs. Grtz Jos On Jun 27, 7:27 am, Contrid [EMAIL PROTECTED] wrote: Hi there, I would like to get some feedback on a specific approach I'm taking. I don't know if this is normal and if it's good (CakePHP) coding practice, since this is my first CakePHP application. I have added a route in my /app/config/routes.php document. It looks like this : $Route - connect('/admin', array('controller' = 'admin', 'action' = 'index')); ...which takes a user/admin to the index method of the AdminController controller whenever /admin/ is accessed. Now...whenever, let's say /admin/files/ is accessed, the user will go to the admin_index method/function of the FilesController controller in my application. Another example is, let's say a user goes to /admin/users/ the user will go to the admin_index method/function inside the UsersController controller. Last example. The administrator is about to edit a user account and goes to /admin/users/edit with POST or GET data. This will mean that the admin_edit method is executed inside the UsersController controller. Is this fine? What do you think about the approach? Is it abnormal to have my admin functions inside the same controller used by users? --~--~-~--~~~---~--~~ 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: Please oh please, at my witt's end. [Sessions]
They are installed on the same machine but under different user accounts. On Jun 28, 8:01 am, Jonathan Langevin [EMAIL PROTECTED] wrote: Are both installations on the same server? If so, are they both installed under the same user account? On 6/28/07, kerkor [EMAIL PROTECTED] wrote: I have cake implemented for one shopping cart and everything seems fine. Client wanted to just copy those files and build a new front-end for the second site. I have copied the files (especially the controllers) multiple times and I have changed all occurrences of the previous site's url. My problem, is that it seems, that new sessions are being created for no reason. Most of the time the application behaves as it should. This is why it is so confusing. My database stores orders by the session id until the user logs in and then the programming sets the session to null and enters a customer id. In my order controller I have this as a beforeFilter() function beforeFilter() { parent::beforeFilter(); $this-session = $this-Session-read('Config.rand'); } Here are the 3 areas where I see session-related problems (note: only on the second site, the first site seems to function fine all the time): 1. On the cart page there is an option of resetting the type of shipping. If you use the drop-down to select something other than the default shipping and click a button update cart, SOMETIMES a new session is created and is updated in the db but then in the code where is looks and compares session it no longer equates since it has been changed. 2. After cart, before 1st checkout page, user is required to login or create account. Session changes so when user logs in customer id is not saved since sessions do not match 3. Every refresh of the page creates a new session WTF? Please if you could offer ANY ideas, I have eaten and spent of 20 hours trying to debug this problem... Thank you ever s much.- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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: One cake application, multiple sites
That sounds like it could work. Thanks for all the help everyone, I've always managed to get good advice here with only the minimum of uncessesary forum attitude that is often found elsewhere!! These suggestions will definately set me on the path to getting a better setup for my purposes. Cheers! On Jun 27, 5:59 pm, francky06l [EMAIL PROTECTED] wrote: Not much choice of having a separate webroot per config. You do not need a switch if in your index.php you define a value such as define('DBCONFIG', 'config1'), etc .. Then in your databse.php you can have multiple dbconfig having the name of the define. In app_model you can set $var $dbConfig = DBCONFIG. Of course you would have to update your css in each webroot (also img etc ..) On Jun 27, 4:50 pm, Jonathan Langevin [EMAIL PROTECTED] wrote: btw, each webroot's index.php would need to be configured to know the cake core and app install locations On 6/27/07, Jonathan Langevin [EMAIL PROTECTED] wrote: if i were you, i'd check into the possibility of upgrading in the meantime, cake core already has the ability to be located elsewhere, as does the app folder, so your only true issue is using a different db config per site what I would do, is put your entire cms in a central accessible location, then copy your app/webroot into each website folder. modify the webroot's index.php to hold a $site_id value, assign a value in each site's index.php then in the database conf file, setup a switch based on the $site_id if you need more help, lemme know On 6/27/07, quincy [EMAIL PROTECTED] wrote: I apologise in advance becasue I know this has come up many times already, but I cannot seem to find the information I'm after. I want to be able to have a single installation of my cake app (a CMS) on a server, and run several sites from the same installation by simply using a different database config file on each one. The only other thing that might change would be CSS files so that each client can have a customized colours or logos etc, but the point is that I want a single point of upgrade for the CMS so that when we reach a new version it can propogate across every site that uses it. To put it another way, one set of models, views and controllers, and many sites running off this one application by simple specifying the relevant DB config file and maybe stylesheets. Thats it. Any help greatly appreciated. I am using quite an old version of cake as upgrades have not been possible during the development of our CMS (long story), the version according to the config is 1.1.14.4797 Cheers --~--~-~--~~~---~--~~ 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: One cake application, multiple sites
On 6/28/07, quincy [EMAIL PROTECTED] wrote: That sounds like it could work. Thanks for all the help everyone, I've always managed to get good advice here with only the minimum of uncessesary forum attitude that is often found elsewhere!! These suggestions will definately set me on the path to getting a better setup for my purposes. Pfft. Things were civil only because I wasn't paying attention to this thread. ;) -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: Just build it, damnit! @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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: save select
I could be wrong, but I think there's only two ways to solve this. 1. Have a select with possibility to select multiple values, and onsubmit have a javascript function that loops through all the options of it and makes them selected. 2. On submit, have a javascript loop through the options and assign the values to a hidden element. Won't demand you to use a multiple- select. Both of these demand javascript, so maybe a better way would be to assign the values to a hidden field while creating the select on the server. Then again, I guess you use javascript on the page anyway...? cheers / Wille On Jun 25, 10:48 pm, Oscar Burgos [EMAIL PROTECTED] wrote: I have declare two selectTag in my form and I need to save all valuesg, but from the second select not just selected. --~--~-~--~~~---~--~~ 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: One cake application, multiple sites
He ain't lyin' :-) On 6/28/07, Chris Hartjes [EMAIL PROTECTED] wrote: On 6/28/07, quincy [EMAIL PROTECTED] wrote: That sounds like it could work. Thanks for all the help everyone, I've always managed to get good advice here with only the minimum of uncessesary forum attitude that is often found elsewhere!! These suggestions will definately set me on the path to getting a better setup for my purposes. Pfft. Things were civil only because I wasn't paying attention to this thread. ;) -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: Just build it, damnit! @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
How to throw exception defined by DB?
Hi, I have set some rules in my DB, for example, some keys must be unique. How can I throw exception generated by the DB when inserting invalid entries? For example, if 'email' in my DB is set to be UNIQUE and I want to add a duplicate 'email', in MySQL, I will get something like: #1062 - Duplicate entry '[EMAIL PROTECTED]' for key 2 How can I get this error and pass it to users (via cake)? Thanks, --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
initial load of an ajax div in view
I think this is simple, but I'm not sure how it is done (my js/ajax is a bit fuzzy, i rely on the helpers :-) I have a div, that is able to add/edit/index etc update itself via the ajax helper functions - works great. However I can't find how you load it in the first instance within the context of a bigger view?? If I create a temp $ajax-link and click that link, it loads the first time and I'm up and running, but I need it to load automatically within the main page. I thought that something like... $ajax-div('events', array('url', '/events/index')); $ajax-divEnd(); ...in the main view would do this, but it doesn't do the first time load. i'm using cake 1.2.0.5146alpha --~--~-~--~~~---~--~~ 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: How to throw exception defined by DB?
Assuming you're using cake 1.2, this may be of assistance \libs\model\datasources\dbo\dbo_mysqli.php /** * Returns a formatted error message from previous database operation. * * @return string Error message with error number */ function lastError() { if (mysqli_errno($this-connection)) { return mysqli_errno($this-connection).': '.mysqli_error($this-connection); } return null; } On 6/28/07, Ming [EMAIL PROTECTED] wrote: Hi, I have set some rules in my DB, for example, some keys must be unique. How can I throw exception generated by the DB when inserting invalid entries? For example, if 'email' in my DB is set to be UNIQUE and I want to add a duplicate 'email', in MySQL, I will get something like: #1062 - Duplicate entry '[EMAIL PROTECTED]' for key 2 How can I get this error and pass it to users (via cake)? Thanks, --~--~-~--~~~---~--~~ 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: How to throw exception defined by DB?
BTW, that method should exist for normal mysql as well On 6/28/07, Jonathan Langevin [EMAIL PROTECTED] wrote: Assuming you're using cake 1.2, this may be of assistance \libs\model\datasources\dbo\dbo_mysqli.php /** * Returns a formatted error message from previous database operation. * * @return string Error message with error number */ function lastError() { if (mysqli_errno($this-connection)) { return mysqli_errno($this-connection).': '.mysqli_error($this-connection); } return null; } On 6/28/07, Ming [EMAIL PROTECTED] wrote: Hi, I have set some rules in my DB, for example, some keys must be unique. How can I throw exception generated by the DB when inserting invalid entries? For example, if 'email' in my DB is set to be UNIQUE and I want to add a duplicate 'email', in MySQL, I will get something like: #1062 - Duplicate entry '[EMAIL PROTECTED]' for key 2 How can I get this error and pass it to users (via cake)? Thanks, --~--~-~--~~~---~--~~ 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: upload behavior
But what if I want to use more than one image? say, Im uploading one teaser (thumbnail) and two images from a news manager. Can I use the UploadBehavior? --~--~-~--~~~---~--~~ 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: initial load of an ajax div in view
you can use $ajax-remoteFunction (check the syntax), into the div at initial load. This content will be updated by the result of your call. Hope this helps On Jun 28, 6:59 pm, Howard Glynn [EMAIL PROTECTED] wrote: I think this is simple, but I'm not sure how it is done (my js/ajax is a bit fuzzy, i rely on the helpers :-) I have a div, that is able to add/edit/index etc update itself via the ajax helper functions - works great. However I can't find how you load it in the first instance within the context of a bigger view?? If I create a temp $ajax-link and click that link, it loads the first time and I'm up and running, but I need it to load automatically within the main page. I thought that something like... $ajax-div('events', array('url', '/events/index')); $ajax-divEnd(); ...in the main view would do this, but it doesn't do the first time load. i'm using cake 1.2.0.5146alpha --~--~-~--~~~---~--~~ 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: initial load of an ajax div in view
to be more precise : $ajax-div('events'); echo $ajax-remoteFunction(array('url' = '/events/index', 'update' = 'events')); $ajax-divEnd('events'); Actually on initial load, you do not even need the $ajax-div / divEnd, but maybe you would put them in your rendered view. On Jun 28, 8:10 pm, francky06l [EMAIL PROTECTED] wrote: you can use $ajax-remoteFunction (check the syntax), into the div at initial load. This content will be updated by the result of your call. Hope this helps On Jun 28, 6:59 pm, Howard Glynn [EMAIL PROTECTED] wrote: I think this is simple, but I'm not sure how it is done (my js/ajax is a bit fuzzy, i rely on the helpers :-) I have a div, that is able to add/edit/index etc update itself via the ajax helper functions - works great. However I can't find how you load it in the first instance within the context of a bigger view?? If I create a temp $ajax-link and click that link, it loads the first time and I'm up and running, but I need it to load automatically within the main page. I thought that something like... $ajax-div('events', array('url', '/events/index')); $ajax-divEnd(); ...in the main view would do this, but it doesn't do the first time load. i'm using cake 1.2.0.5146alpha --~--~-~--~~~---~--~~ 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: Cake 12 validation
I have been reading all I could find already .. and that was great help. Also the validation message (set in the model) does not take in account the L10N (for multi-language). Easy to fix, but I will wait the class is finished. Thanks On Jun 28, 4:17 pm, Walker Hamilton [EMAIL PROTECTED] wrote: Ohin the meantime, read this:http://cakebaker.42dh.com/2007/01/03/validation-with-cakephp-12/ --~--~-~--~~~---~--~~ 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: Cake 12 validation
Here are some of my validation rules, in case this helps any... btw, in the view, I use $form-input of course, which displays validation messages if any A note to keep in mind, this works great for user registration, but I haven't build a method for editing users yet. the 'validateUnique' rules might need to be tested/inspected to make sure it works for editing existing entries var $validate = array( 'username' = array( 'length' = array( 'rule' = array('between', 6, 40), 'message' = 'Your username must have between 6 and 40 characters'), 'unique' = array( 'rule' = array('validateUnique', 'username'), 'message' = 'The username you entered already exists' ), ), 'password' = array( 'length' = array( 'rule' = array('between', 6, 40), 'message' = 'Your password must have between 6 and 40 characters'), ), 'email' = array( 'length' = array( 'rule' = array('between', 1, 255), 'message' = 'Your email must have between 1 and 255 characters'), 'unique' = array( 'rule' = array('validateUnique', 'email'), 'message' = 'The email address you entered already exists' ), 'format' = array( 'rule' = 'email', 'message' = 'The email address you provided is not valid'), ), 'first_name' = array( 'length' = array( 'rule' = array('between', 1, 64), 'message' = 'Your first name must have between 1 and 64 characters'), ), 'last_name' = array( 'length' = array( 'rule' = array('between', 1, 64), 'message' = 'Your last name must have between 1 and 64 characters'), ), ); On 6/28/07, Howard Glynn [EMAIL PROTECTED] wrote: On 6/28/07, francky06l [EMAIL PROTECTED] wrote: Hello, I am working on validation in 1.2 and I discovered some strange behaviors. I would really like for someone to post their real world working 1.2validation model using a varied mix of the capabilities. I've read most of the docs but still don't have a clear picture. I'm sure an actual example would be useful, and I would hazard a guess most of us could work out what we need to know from that and better exploit the feature. I'm sure I can do better than valid_not_empty :-) HG --~--~-~--~~~---~--~~ 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: dukudu.de made with CakePHP
Ok, so let's move on and get creative -- Felix Definitely! --~--~-~--~~~---~--~~ 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: initial load of an ajax div in view
On 6/28/07, francky06l [EMAIL PROTECTED] wrote: to be more precise : $ajax-div('events'); echo $ajax-remoteFunction(array('url' = '/events/index', 'update' = 'events')); $ajax-divEnd('events'); Almost there, but not quite!! - but the pointer you gave allowed me to solve it - thanks For the archives next time someone is searching: echo $ajax-div('events'); echo $javascript-codeBlock( $ajax-remoteFunction(array('url' = '/events/index', 'update' = 'events')) ); echo $ajax-divEnd('events'); That auto loads the div with /events/index view when the page loads, at which point the actions in the div can take over. If you want another way of putting it, I'm sort of trying to emulate something like the task list demo ( http://www.grahambird.co.uk/cake/tutorials/ajax.php ) as part of a wider page. --~--~-~--~~~---~--~~ 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: HABTM relationship and meta-data in link-table
djiize, What version of CakePHP are you using? I haven't been able to get the 'with' parametera on a hABTM relationship working. Thanks for any info you have on this. On Jun 20, 5:38 pm, djiize [EMAIL PROTECTED] wrote: Take this cautiously, it's just an experiment. I just found an interest for the 'with' parameter when defining an HABTM when reading the source code. So I defined that: class Estate extends AppModel { var $name = 'Estate'; var $hasAndBelongsToMany= array( 'Service' = array( 'with' = 'EstateService', ), ); } class Service extends AppModel { var $name = 'Service'; var $hasAndBelongsToMany= array('Estate'); } My view action warned me about a EstateService model, so... class EstateService extends AppModel { var $name = 'EstateService'; var $useTable = 'estates_services'; // for some Inflector reasons I didn't care about for now, I must add that or Model search for estate_services table } And now in my view, I have that: Array ( [Estate] = Array ( [id] = 1 [name] = lorem ipsum [description] = dolor sit amet [type_id] = 1 [created] = 2007-06-20 23:08:03 [modified] = 2007-06-20 23:10:33 ) [Type] = Array ( [id] = 1 [name] = Apartment ) [Service] = Array ( [0] = Array ( [id] = 1 [name] = Service1 [EstateService] = Array ( [estate_id] = 1 [service_id] = 1 [comment] = test1 ) ) [1] = Array ( [id] = 3 [name] = Service2 [EstateService] = Array ( [estate_id] = 1 [service_id] = 3 [comment] = test2 ) ) ) ) Tadaa, did you see the comment field? ;) And thanks to this design, you can also use another table than the real join-table. Maybe someone more experimented with this technic can add his comments please? Just to confirm I don't misunderstand the purpose of this parameter... I repeat, take this cautiously, I'm only playing with this thing for half an hour now On 20 juin, 22:46, BoSc [EMAIL PROTECTED] wrote: Does this allow me to update the join-table, also the columns that are not really part of the HABTM association? Also, at the moment I solved this using the Has Many -- Belongs to -- Has many method. The solution was to use the recursive variable. thanks for the help so far. On Jun 20, 1:59 pm, Joshua Benner [EMAIL PROTECTED] wrote: I did something similar, where 'faculty' has and belongs to many 'activity' and each link has a student count associated with it -- I used a custom finderQuery in the definition of the association to pull the student count field with all the other data (TSQL, so some minor differences from MySQL, and this works with cake 1.2): var $hasAndBelongsToMany = array( 'Activity' = array('className' = 'Activity', 'joinTable' = 'activity_links', 'foreignKey' = 'faculty_id', 'associationForeignKey' = 'activity_id', 'unique' = true, 'finderQuery' = ' SELECT [Activity].[id] as [Activity.id], [Activity].[name] as [Activity.name], [Activity].[activity_type_id] as [Activity.activity_type_id], [Activity].[credits] as [Activity.credits], [ActivityLink].[students] as [Activity.students], [ActivityLink].[id] as [Activity.activity_link_id] FROM [activities] AS [Activity] JOIN [activity_links] AS [ActivityLink] ON [ActivityLink]. [activity_id] = [Activity].[id] WHERE [ActivityLink].[faculty_id] = {$__cakeID__$} ORDER BY [Activity].[name] ASC' ) On Jun 20, 6:03 am, BoSc [EMAIL PROTECTED] wrote: Hi, I have three tables: cities categories categories_cities The first two are normal tables, the third one is used for linking. Since I want to be able to indicate if the link is active, I've added a column active to the
Re: Cake 1.2alpha path question
mod-rewrite problem ? Check if you can enable it, also your .htaccess in webroot. On Jun 28, 3:28 pm, chanh.ong [EMAIL PROTECTED] wrote: I have this file in my cake 1.2alpha /home/groups/c/co/coaddons/htdocs/caketest/app/views/pages/hello.thtml But I got this error when try to access my hello page using this urlhttp://coaddons.sourceforge.net/caketest/pages/hello An error has been encountered in accessing this page 1. Server: coaddons.sourceforge.net 2. URL path: /caketest/pages/hello. 3. Error notes: File does not exist: /home/groups/c/co/coaddons/htdocs/ caketest/pages/hello. 4. Error type: 404 5. Request method: GET 6. Request query string: 7. Time: 2007-06-28 06:15:18 PDT (1183036518) Note the 1st line is the physical location of the file and the 2nd is access from url with the error. /home/groups/c/co/coaddons/htdocs/caketest/app/views/pages/hello.thtml /home/groups/c/co/coaddons/htdocs/caketest/pages/hello My question is why Cake 1.2alpha can't find the file. Am I missing something real simple here! Thanks --~--~-~--~~~---~--~~ 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: trouble in Notice: Undefined index:
has you have many times 'User' in login function, very hard to find out which line. However 'User' is not equal to 'user' in : $this-Session-write('last_login',$results['user'] ['last_login']); On Jun 28, 12:27 pm, yudhi prasetyo [EMAIL PROTECTED] wrote: hello All i'm newbie in cake world =), i've trouble when i learn some tutorial from ibm (cook up web fast using cakephp part2) /--template-- (index.thtml)/ pHello,?e($User)['first_name'].''.$User['last_name'])?/p pyour last login was on ?e($last_login)? ?echo $html-link('knownusers','/users/knownusers')??echo $html-link('logout','users/logout')? /-- in mine controller--(users_controller.php)/ function login() { $this-set('error',false); if($this-data) { $results=$this-User-findByUsername($this-data['User']['username']); if($results $results['User']['password']==md5($this-data['User']['password'])) { $this-Session-write('user',$this-data['User']['username']); $this-Session-write('last_login',$results['user']['last_login']); $results['User']['last_login'] = date(Y-m-d H:i:s); $this-User-save($results); $this-redirect('/users/index'); }else { $this-set('error',true); } } } function index() { $username=$this-Session-read('user'); if($username) { $username=$this-User-findByUsername($username); $this-set('User',$results['User']); $this-set('last_login',$this-Session-read('last_login')); }else{ $this-redirect('/users/login'); } } the trouble is when i execute,i've got error message like this; Notice: Undefined index: User in C:\xampp\htdocs\kerjaan\cake\latianbake\controllers\users_controller.php on line 43 line 43 is in function login anyone can help me please ? thx before =) -- -yprs- --~--~-~--~~~---~--~~ 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: Cake 1.2alpha path question
I had to change the paths.php to this so that I can write to a place where it has permission: define ('TMP', DS.'tmp'.DS.'persistent'.DS.'coaddons'.DS.'tmp'.DS); I turn on mod_rewrite and this is what I got: 1. Server: coaddons.sourceforge.net 2. URL path: /home/groups/c/co/coaddons/htdocs/caketest/app/webroot/ pages/hello 3. Error notes: File does not exist: /home/groups/c/co/coaddons/htdocs/ home/groups/c/co/coaddons/htdocs/caketest/app/webroot/pages/hello 4. Error type: 404 5. Request method: GET 6. Request query string: 7. Time: 2007-06-28 15:26:26 PDT (1183069586) It looks like something do a double path to the file, not sure where it does that!! Thanks On Jun 28, 2:01 pm, francky06l [EMAIL PROTECTED] wrote: mod-rewrite problem ? Check if you can enable it, also your .htaccess in webroot. On Jun 28, 3:28 pm, chanh.ong [EMAIL PROTECTED] wrote: I have this file in my cake 1.2alpha /home/groups/c/co/coaddons/htdocs/caketest/app/views/pages/hello.thtml But I got this error when try to access my hello page using this urlhttp://coaddons.sourceforge.net/caketest/pages/hello An error has been encountered in accessing this page 1. Server: coaddons.sourceforge.net 2. URL path: /caketest/pages/hello. 3. Error notes: File does not exist: /home/groups/c/co/coaddons/htdocs/ caketest/pages/hello. 4. Error type: 404 5. Request method: GET 6. Request query string: 7. Time: 2007-06-28 06:15:18 PDT (1183036518) Note the 1st line is the physical location of the file and the 2nd is access from url with the error. /home/groups/c/co/coaddons/htdocs/caketest/app/views/pages/hello.thtml /home/groups/c/co/coaddons/htdocs/caketest/pages/hello My question is why Cake 1.2alpha can't find the file. Am I missing something real simple here! Thanks --~--~-~--~~~---~--~~ 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: Cake 1.2alpha path question
The only other change that I made is the database.php and turn on debug and admin in the core.php. That's it! On Jun 28, 3:32 pm, chanh.ong [EMAIL PROTECTED] wrote: I had to change the paths.php to this so that I can write to a place where it has permission: define ('TMP', DS.'tmp'.DS.'persistent'.DS.'coaddons'.DS.'tmp'.DS); I turn on mod_rewrite and this is what I got: 1. Server: coaddons.sourceforge.net 2. URL path: /home/groups/c/co/coaddons/htdocs/caketest/app/webroot/ pages/hello 3. Error notes: File does not exist: /home/groups/c/co/coaddons/htdocs/ home/groups/c/co/coaddons/htdocs/caketest/app/webroot/pages/hello 4. Error type: 404 5. Request method: GET 6. Request query string: 7. Time: 2007-06-28 15:26:26 PDT (1183069586) It looks like something do a double path to the file, not sure where it does that!! Thanks On Jun 28, 2:01 pm, francky06l [EMAIL PROTECTED] wrote: mod-rewrite problem ? Check if you can enable it, also your .htaccess in webroot. On Jun 28, 3:28 pm, chanh.ong [EMAIL PROTECTED] wrote: I have this file in my cake 1.2alpha /home/groups/c/co/coaddons/htdocs/caketest/app/views/pages/hello.thtml But I got this error when try to access my hello page using this urlhttp://coaddons.sourceforge.net/caketest/pages/hello An error has been encountered in accessing this page 1. Server: coaddons.sourceforge.net 2. URL path: /caketest/pages/hello. 3. Error notes: File does not exist: /home/groups/c/co/coaddons/htdocs/ caketest/pages/hello. 4. Error type: 404 5. Request method: GET 6. Request query string: 7. Time: 2007-06-28 06:15:18 PDT (1183036518) Note the 1st line is the physical location of the file and the 2nd is access from url with the error. /home/groups/c/co/coaddons/htdocs/caketest/app/views/pages/hello.thtml /home/groups/c/co/coaddons/htdocs/caketest/pages/hello My question is why Cake 1.2alpha can't find the file. Am I missing something real simple here! Thanks --~--~-~--~~~---~--~~ 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: validating password
In 1.2 $form-input() automatically picks up the error message and you don't need to set error in the view. In 1.1 I think you need to use $html-errorTag() or something like that. Either way you shouldn't set the error message in the view, it should be pulled from the models validationErrors On Jun 28, 4:40 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: If i use $this-invalidate(password, Passwords do not match); how do i associate that in my view.. Currently my view has ?php echo $form-input('password', array('error' = 'Password must be at least 4 characters.', 'type'='password', 'value' ='')); ? for the password.. If i do as you say, i still get the error about being at least 4 characters.. Personally i'd rather not even have the error messages in the view but in the models.. How do i set the error from invalidate to display in the views? On Jun 27, 4:27 pm, Grant Cox [EMAIL PROTECTED] wrote: I would use $this-invalidate('password', Passwords do not match) - this way it is just the same as any other validation routine. You also don't need to call beforeValidate() in your beforeSave, it is done automatically by Cake when you save. Your beforeSave is still MD5-ing every password that gets put in there. So, if you do: $existing_user = $this-User-read(null, $user_id); $existing_user['User']['name'] = 'I am changing your name'; $this-User-save( $existing_user ); then your password is now double MD5'd. What I was saying previously is that the field submitted from the form that has the plain text password should not be the actual password field used in your database. So if you use password in the database to indicate a hashed password, then on your form make the field plain_password or new_password or something - this way in your beforeSave you know if it needs to be MD5'd, otherwise don't change. The plain_password should not be saved into the db at all. And you're right, the hashed password field should not appear in a form either. --~--~-~--~~~---~--~~ 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: How can I get the execution time of PHP code and DB access?
Finally you can have ob_start(); $db = ConnectionManager::getDataSource('default'); $db-showLog(); $log_contents = ob_get_clean(); $this-log( $log_contents ); However, the showLog function is hardcoded to embed HTML styling if you are not running command line. It might be worth writing your own function somewhere to grab the $db-_queriesLog directly and output it how you like (then you won't have to worry about using the output buffer too). --~--~-~--~~~---~--~~ 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: multiple line file import problem.
You are not assigning $this-details anywhere. if($this-User-save()) { $this-Session-setFlash('The User has been saved'); } Should be if($this-User-save($this-details)) { $this-Session-setFlash('The User has been saved'); } Geoff -- http://lemoncake.wordpress.com On Jun 28, 8:41 pm, Gould, Adrian [EMAIL PROTECTED] wrote: Thanks Maj... -Original Message- From: cake-php@googlegroups.com on behalf of majna Sent: Thu 6/28/2007 16:41 To: Cake PHP Subject: Re: multiple line file import problem. Add befrore save $this-User-create(); // save the imported user data $this-User-save($this-data); On Jun 28, 8:56 am, Gould, Adrian [EMAIL PROTECTED] wrote: I am attempting to import a file that has been uploaded to a imports folder in the correct location... I have had the import routine saving an entry, but when the next line is imported it does nto create a new record but updates the previous one. How can I do this... // open the file for reading if (! $fd = @fopen($csvFile, r)) { die(Failed to open input file); } // set header to true $header = true; // read the file using the automatic csv conversion routines while ($fields = fgetcsv($fd)) { // if it the header then skip the row if ($header) { /* skip CSV header row */ $header = false; continue; } else { // parse the imported data into the data array ready for saving $this-data = $this-__parse_csv_row($fields); // save the imported user data $this-User-save($this-data); } } Am I barking up the wrong tree on the way -save works? Can I not get it to function this way? Thanks Ady --~--~-~--~~~---~--~~ 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: Cake 1.2alpha path question
Have we not been through mod_rewrite on sourceforge with you before http://groups.google.com/group/cake-php/browse_thread/thread/13576f093e0c4e1c/4afeee889172f549?lnk=gstq=coaddonsrnum=2#4afeee889172f549 On Jun 29, 8:36 am, chanh.ong [EMAIL PROTECTED] wrote: The only other change that I made is the database.php and turn on debug and admin in the core.php. That's it! On Jun 28, 3:32 pm, chanh.ong [EMAIL PROTECTED] wrote: I had to change the paths.php to this so that I can write to a place where it has permission: define ('TMP', DS.'tmp'.DS.'persistent'.DS.'coaddons'.DS.'tmp'.DS); I turn on mod_rewrite and this is what I got: 1. Server: coaddons.sourceforge.net 2. URL path: /home/groups/c/co/coaddons/htdocs/caketest/app/webroot/ pages/hello 3. Error notes: File does not exist: /home/groups/c/co/coaddons/htdocs/ home/groups/c/co/coaddons/htdocs/caketest/app/webroot/pages/hello 4. Error type: 404 5. Request method: GET 6. Request query string: 7. Time: 2007-06-28 15:26:26 PDT (1183069586) It looks like something do a double path to the file, not sure where it does that!! Thanks On Jun 28, 2:01 pm, francky06l [EMAIL PROTECTED] wrote: mod-rewrite problem ? Check if you can enable it, also your .htaccess in webroot. On Jun 28, 3:28 pm, chanh.ong [EMAIL PROTECTED] wrote: I have this file in my cake 1.2alpha /home/groups/c/co/coaddons/htdocs/caketest/app/views/pages/hello.thtml But I got this error when try to access my hello page using this urlhttp://coaddons.sourceforge.net/caketest/pages/hello An error has been encountered in accessing this page 1. Server: coaddons.sourceforge.net 2. URL path: /caketest/pages/hello. 3. Error notes: File does not exist: /home/groups/c/co/coaddons/htdocs/ caketest/pages/hello. 4. Error type: 404 5. Request method: GET 6. Request query string: 7. Time: 2007-06-28 06:15:18 PDT (1183036518) Note the 1st line is the physical location of the file and the 2nd is access from url with the error. /home/groups/c/co/coaddons/htdocs/caketest/app/views/pages/hello.thtml /home/groups/c/co/coaddons/htdocs/caketest/pages/hello My question is why Cake 1.2alpha can't find the file. Am I missing something real simple here! Thanks --~--~-~--~~~---~--~~ 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: Cake 1.2alpha path question
Ok just noticed that it is a different problem - did you get mod_rewrite to work properly? Your new problem is a path definition error. 3. Error notes: File does not exist: /home/groups/c/co/coaddons/htdocs/ home/groups/c/co/coaddons/htdocs/caketest/app/webroot/pages/hello Its got your base in there twice for some reason. You may need to look at the path defines in index.php and make sure they are correct. Also try getting the latest revision of 1.2. Geoff -- http://lemoncake.wordpress.com On Jun 29, 9:16 am, Geoff Ford [EMAIL PROTECTED] wrote: Have we not been through mod_rewrite on sourceforge with you before http://groups.google.com/group/cake-php/browse_thread/thread/13576f09... On Jun 29, 8:36 am, chanh.ong [EMAIL PROTECTED] wrote: The only other change that I made is the database.php and turn on debug and admin in the core.php. That's it! On Jun 28, 3:32 pm, chanh.ong [EMAIL PROTECTED] wrote: I had to change the paths.php to this so that I can write to a place where it has permission: define ('TMP', DS.'tmp'.DS.'persistent'.DS.'coaddons'.DS.'tmp'.DS); I turn on mod_rewrite and this is what I got: 1. Server: coaddons.sourceforge.net 2. URL path: /home/groups/c/co/coaddons/htdocs/caketest/app/webroot/ pages/hello 3. Error notes: File does not exist: /home/groups/c/co/coaddons/htdocs/ home/groups/c/co/coaddons/htdocs/caketest/app/webroot/pages/hello 4. Error type: 404 5. Request method: GET 6. Request query string: 7. Time: 2007-06-28 15:26:26 PDT (1183069586) It looks like something do a double path to the file, not sure where it does that!! Thanks On Jun 28, 2:01 pm, francky06l [EMAIL PROTECTED] wrote: mod-rewrite problem ? Check if you can enable it, also your .htaccess in webroot. On Jun 28, 3:28 pm, chanh.ong [EMAIL PROTECTED] wrote: I have this file in my cake 1.2alpha /home/groups/c/co/coaddons/htdocs/caketest/app/views/pages/hello.thtml But I got this error when try to access my hello page using this urlhttp://coaddons.sourceforge.net/caketest/pages/hello An error has been encountered in accessing this page 1. Server: coaddons.sourceforge.net 2. URL path: /caketest/pages/hello. 3. Error notes: File does not exist: /home/groups/c/co/coaddons/htdocs/ caketest/pages/hello. 4. Error type: 404 5. Request method: GET 6. Request query string: 7. Time: 2007-06-28 06:15:18 PDT (1183036518) Note the 1st line is the physical location of the file and the 2nd is access from url with the error. /home/groups/c/co/coaddons/htdocs/caketest/app/views/pages/hello.thtml /home/groups/c/co/coaddons/htdocs/caketest/pages/hello My question is why Cake 1.2alpha can't find the file. Am I missing something real simple here! Thanks --~--~-~--~~~---~--~~ 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: Safari 3 and Firefox do not understand the urls my cake app is generating...
A 404 is generated by your server - not the client. Is the 404 generated by Cake, or by your webserver? If by cake, set the DEBUG to 1 and see what the real error is (ie missing model/view/ controller file). If by your webserver, then the request isn't even getting to cake - so look at your webserver logs to see what the real request was - these browsers may be mangling it a little. I'm not sure if I've used exactly 1.1.13, but none our cake apps have problems with safari or firefox on a mac. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Paginating correctly when having two models with the same field names?
#I have the Model Tipo class Tipo extends AppModel { var $displayField = 'nombre'; var $hasMany = array('Productos'=array( 'className'='Producto', 'foreignKey'='id_tipo' ) ); } #and Model Producto class Producto extends AppModel { var $displayField = 'nombre'; var $belongsTo = array('Tipo'=array( 'className'='Tipo', 'foreignKey'='id_tipo') ); } #and the controller productos_controller.php /* Iam using pagination */ class ProductosController extends AppController { var $uses = array('Producto', 'Tipo'); var $paginate = array('Producto'=array('limit' = LIMIT), 'Tipo'=array('limit' = LIMIT)); function index() { $productos = $this-paginate('Producto'); $this-set('productos', $productos ); } } #And my view is table class=tabla width=700 caption ?php echo $html-link('Crear Producto', 'add/').'br/';? div class=paging Página ?php echo $paginator-counter(array('separator' = ' de ')); ? ?php echo $paginator-prev('Ant').' '.$paginator-next('Sig')? /div /caption ?php $tr = array($paginator-sort('ID', 'id', array('model'='Producto')), $paginator-sort('Nombre', 'nombre', array('model'='Producto')), $paginator-sort('Páginas', 'paginas', array('model'='Producto')), $paginator-sort('Creado', 'creado', array('model'='Producto')), $paginator-sort('Tipo', 'nombre', array('model'='Tipo')), 'Acciones'); echo $html-tableHeaders($tr); ? ?php //echo pr($this-params); foreach($productos as $v) { $id = $v['Producto']['id_producto']; $link = 'small'; $link.= $html-link('ver',view/$id).' '; $link.= $html-link('editar',edit/$id).' '; $link.= $html-link('borrar', delete/$id,null,Esta seguro de Borrar el ID $id); $link.= '/small'; $tr = array( $id, $v['Producto']['nombre'], 'div class=r'.$v['Producto']['paginas'].'/div', $date-dateFormat($v['Producto']['creado']), $v['Tipo']['nombre'], $link ); echo $html-tableCells($tr,null, array('class'='altRow') ); } ? /table /***/ My question is how can I make to order using the Model 'Tipo' and the field nombre when I click on the header table 'Tipo' which holds the Tipo.nombre it orders the table by Producto.nombre but If I use: $paginator-sort('Tipo', 'Tipo.nombre', array('model'='Tipo')) it orders asc using the Tipo model but I can't make it order desc. How can I make make this happen. Thanx in advance. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Session being dropped. CAKE Pros, I need you.
I have cake implemented for one shopping cart and everything seems fine. Client wanted to just copy those files and build a new front-end for the second site. I have copied the files (especially the controllers) multiple times and I have changed all occurrences of the previous site's url. My problem, is that it seems, that new sessions are being created for no reason. Most of the time the application behaves as it should. This is why it is so confusing. My database stores orders by the session id until the user logs in and then the programming sets the session to null and enters a customer id. In my order controller I have this as a beforeFilter() function beforeFilter() { parent::beforeFilter(); $this-session = $this-Session-read('Config.rand'); } Here are the 3 areas where I see session-related problems (note: only on the second site, the first site seems to function fine all the time): 1. On the cart page there is an option of resetting the type of shipping. If you use the drop-down to select something other than the default shipping and click a button update cart, SOMETIMES a new session is created and is updated in the db but then in the code where is looks and compares session it no longer equates since it has been changed. 2. After cart, before 1st checkout page, user is required to login or create account. Session changes so when user logs in customer id is not saved since sessions do not match 3. Every refresh of the page creates a new session WTF? Please if you could offer ANY ideas, I have eaten and spent of 20 hours trying to debug this problem... Thank you ever s much. --~--~-~--~~~---~--~~ 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: multiple line file import problem [solved]
Thanks Geoff it did have that in there at one point and did not work, then realised that the model had changed a little so removed the validation on a field that no longer needed to be filled and voila! Thank you for all the help. Ady --~--~-~--~~~---~--~~ 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: How can I get the execution time of PHP code and DB access?
Yes, I rewrited the showLog function in 'dbo_source.php' and save the DB query infor into a file.It worked,ha,thanks. 2007/6/29, Grant Cox [EMAIL PROTECTED]: Finally you can have ob_start(); $db = ConnectionManager::getDataSource('default'); $db-showLog(); $log_contents = ob_get_clean(); $this-log( $log_contents ); However, the showLog function is hardcoded to embed HTML styling if you are not running command line. It might be worth writing your own function somewhere to grab the $db-_queriesLog directly and output it how you like (then you won't have to worry about using the output buffer too). --~--~-~--~~~---~--~~ 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: Cake 1.2alpha path question
I rename .htaccess and index.php in cake, app and webroot and add some echo code in bootstrap.php to see what is the value of those constant. As I walk down the path and here is what I got echo back. Any idea how to get this to work! I use the latest 1.2 code that I can down from cake site. Thanks ROOT=/home/groups/c/co/coaddons/htdocs/caketest APP_DIR=app WEBROOT_DIR=webroot WWW_ROOT=/home/groups/c/co/coaddons/htdocs/caketest/app/webroot/ CAKE_CORE_INCLUDE_PATH=/home/groups/c/co/coaddons/htdocs/caketest CORE_PATH= APP_PATH= BASE_URL=BASE_URL ROOT=/home/groups/c/co/coaddons/htdocs/caketest APP_DIR=app WEBROOT_DIR=webroot WWW_ROOT=/home/groups/c/co/coaddons/htdocs/caketest/app/webroot/ CAKE_CORE_INCLUDE_PATH=/home/groups/c/co/coaddons/htdocs/caketest CORE_PATH= APP_PATH= Notice (8): Use of undefined constant BASE_URL - assumed 'BASE_URL' [CORE/cake/bootstrap.php, line 152] Context | Code $SHELL = /bin/bash $SSH_CLIENT = 10.5.1.30 37356 22 $USER = root $PATH = /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin $MAIL = /var/mail/root $PWD= /var/local/mastertree/service-prweb/babysitter/httpd-overload $LANG = en_US.UTF-8 $HOME = /root $SHLVL = 4 $PYTHONPATH = /var/local/mastertree/all/babysitter $LOGNAME= root $SSH_CONNECTION = 10.5.1.30 37356 10.5.1.114 22 $_ = /sbin/initlog $username = puiHWbN0SE4= $__utma = 191645736.63192200.1180416069.1183001025.1183003493.18 $__utmz = 191645736.1182832175.15.5.utmccn=(referral)| utmcsr=interactole.org|utmcct=/spaces/space.php|utmcmd=referral $DOCUMENT_ROOT = /var/www $HTTP_ACCEPT= text/xml,application/xml,application/xhtml+xml,text/ html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 $HTTP_ACCEPT_CHARSET= ISO-8859-1,utf-8;q=0.7,*;q=0.7 $HTTP_ACCEPT_ENCODING = gzip,deflate $HTTP_ACCEPT_LANGUAGE = en-us,en;q=0.5 $HTTP_CONNECTION= keep-alive $HTTP_COOKIE= username=puiHWbN0SE4%3D; __utma=191645736.63192200.1180416069.1183001025.1183003493.18; __utmz=191645736.1182832175.15.5.utmccn=(referral)| utmcsr=interactole.org|utmcct=/spaces/space.php|utmcmd=referral $HTTP_HOST = coaddons.sourceforge.net $HTTP_KEEP_ALIVE= 300 $HTTP_USER_AGENT= Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv: 1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 $REDIRECT_SCRIPT_URI= http://coaddons.sourceforge.net/caketest/app/; $REDIRECT_SCRIPT_URL= /caketest/app/ $REDIRECT_STATUS= 200 $REDIRECT_UNIQUE_ID = RoSKQgoDAXIAAHFnd6w $REDIRECT_URL = /caketest/app/ $REMOTE_ADDR= 75.92.157.30 $REMOTE_PORT= 61955 $SCRIPT_FILENAME= /home/groups/c/co/coaddons/htdocs/caketest/app/ index.php $SCRIPT_URI = http://coaddons.sourceforge.net/caketest/app/; $SCRIPT_URL = /caketest/app/ $SERVER_ADDR= 10.4.1.114 $SERVER_ADMIN = [EMAIL PROTECTED] $SERVER_NAME= coaddons.sourceforge.net $SERVER_PORT= 80 $SERVER_SIGNATURE = Apache/1.3.33 Server at coaddons.sourceforge.net Port 80 $SERVER_SOFTWARE= Apache/1.3.33 (Unix) PHP/4.3.10 $UNIQUE_ID = RoSKQgoDAXIAAHFnd6w $GATEWAY_INTERFACE = CGI/1.1 $SERVER_PROTOCOL= HTTP/1.1 $REQUEST_METHOD = GET $QUERY_STRING = $REQUEST_URI= /caketest/app/ $SCRIPT_NAME= /caketest/app/index.php $PATH_TRANSLATED= /home/groups/c/co/coaddons/htdocs/caketest/app/ index.php $PHP_SELF = /caketest/app/index.php $argv = array() $argc = 0 $HTTP_POST_VARS = array() $_POST = array() $HTTP_GET_VARS = array() $_GET = array() $HTTP_COOKIE_VARS = array(username = puiHWbN0SE4=, __utma = 191645736.63192200.1180416069.1183001025.1183003493.18, __utmz = 191645736.1182832175.15.5.utmccn=(referral)|utmcsr=interactole.org| utmcct=/spaces/space.php|utmcmd=referral) $_COOKIE= array(username = puiHWbN0SE4=, __utma = 191645736.63192200.1180416069.1183001025.1183003493.18, __utmz = 191645736.1182832175.15.5.utmccn=(referral)|utmcsr=interactole.org| utmcct=/spaces/space.php|utmcmd=referral) $HTTP_SERVER_VARS = array(DOCUMENT_ROOT = /var/www, HTTP_ACCEPT = text/xml,application/xml,application/xhtml+xml,text/ html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5, HTTP_ACCEPT_CHARSET = ISO-8859-1,utf-8;q=0.7,*;q=0.7, HTTP_ACCEPT_ENCODING = gzip,deflate, HTTP_ACCEPT_LANGUAGE = en-us,en;q=0.5, HTTP_CONNECTION = keep-alive, HTTP_COOKIE = username=puiHWbN0SE4%3D; __utma=191645736.63192200.1180416069.1183001025.1183003493.18; __utmz=191645736.1182832175.15.5.utmccn=(referral)| utmcsr=interactole.org|utmcct=/spaces/space.php|utmcmd=referral, HTTP_HOST = coaddons.sourceforge.net, HTTP_KEEP_ALIVE = 300, HTTP_USER_AGENT = Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US;
Re: upload behavior
On 6/28/07, Niño Astronauta [EMAIL PROTECTED] wrote: But what if I want to use more than one image? say, Im uploading one teaser (thumbnail) and two images from a news manager. Can I use the UploadBehavior? Yes. Tarique = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = --~--~-~--~~~---~--~~ 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: validating password
On 6/29/07, Geoff Ford [EMAIL PROTECTED] wrote: Either way you shouldn't set the error message in the view, it should be pulled from the models validationErrors I would like to add a small amendment to the above - You need not set the error message in the view, it can be pulled from the model's validationErrors. However ideally your should set error messages in view. Cheers Tarique = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = --~--~-~--~~~---~--~~ 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: Cake 1.2alpha path question
Actually I think it may be a htaccess issue. When I go to http://coaddons.sourceforge.net/cake/pages/hello I get exactly the same error as your first post. When I go to http://coaddons.sourceforge.net/cake/index.php/pages/hello I get the expected the expected page. What does your htaccess look like? BTW all those paths are correct Geoff -- http://lemoncake.wordpress.com On Jun 29, 2:33 pm, chanh.ong [EMAIL PROTECTED] wrote: I rename .htaccess and index.php in cake, app and webroot and add some echo code in bootstrap.php to see what is the value of those constant. As I walk down the path and here is what I got echo back. Any idea how to get this to work! I use the latest 1.2 code that I can down from cake site. Thanks ROOT=/home/groups/c/co/coaddons/htdocs/caketest APP_DIR=app WEBROOT_DIR=webroot WWW_ROOT=/home/groups/c/co/coaddons/htdocs/caketest/app/webroot/ CAKE_CORE_INCLUDE_PATH=/home/groups/c/co/coaddons/htdocs/caketest CORE_PATH= APP_PATH= BASE_URL=BASE_URL ROOT=/home/groups/c/co/coaddons/htdocs/caketest APP_DIR=app WEBROOT_DIR=webroot WWW_ROOT=/home/groups/c/co/coaddons/htdocs/caketest/app/webroot/ CAKE_CORE_INCLUDE_PATH=/home/groups/c/co/coaddons/htdocs/caketest CORE_PATH= APP_PATH= Notice (8): Use of undefined constant BASE_URL - assumed 'BASE_URL' [CORE/cake/bootstrap.php, line 152] Context | Code $SHELL = /bin/bash $SSH_CLIENT = 10.5.1.30 37356 22 $USER = root $PATH = /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin $MAIL = /var/mail/root $PWD= /var/local/mastertree/service-prweb/babysitter/httpd-overload $LANG = en_US.UTF-8 $HOME = /root $SHLVL = 4 $PYTHONPATH = /var/local/mastertree/all/babysitter $LOGNAME= root $SSH_CONNECTION = 10.5.1.30 37356 10.5.1.114 22 $_ = /sbin/initlog $username = puiHWbN0SE4= $__utma = 191645736.63192200.1180416069.1183001025.1183003493.18 $__utmz = 191645736.1182832175.15.5.utmccn=(referral)| utmcsr=interactole.org|utmcct=/spaces/space.php|utmcmd=referral $DOCUMENT_ROOT = /var/www $HTTP_ACCEPT= text/xml,application/xml,application/xhtml+xml,text/ html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 $HTTP_ACCEPT_CHARSET= ISO-8859-1,utf-8;q=0.7,*;q=0.7 $HTTP_ACCEPT_ENCODING = gzip,deflate $HTTP_ACCEPT_LANGUAGE = en-us,en;q=0.5 $HTTP_CONNECTION= keep-alive $HTTP_COOKIE= username=puiHWbN0SE4%3D; __utma=191645736.63192200.1180416069.1183001025.1183003493.18; __utmz=191645736.1182832175.15.5.utmccn=(referral)| utmcsr=interactole.org|utmcct=/spaces/space.php|utmcmd=referral $HTTP_HOST = coaddons.sourceforge.net $HTTP_KEEP_ALIVE= 300 $HTTP_USER_AGENT= Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv: 1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 $REDIRECT_SCRIPT_URI= http://coaddons.sourceforge.net/caketest/app/; $REDIRECT_SCRIPT_URL= /caketest/app/ $REDIRECT_STATUS= 200 $REDIRECT_UNIQUE_ID = RoSKQgoDAXIAAHFnd6w $REDIRECT_URL = /caketest/app/ $REMOTE_ADDR= 75.92.157.30 $REMOTE_PORT= 61955 $SCRIPT_FILENAME= /home/groups/c/co/coaddons/htdocs/caketest/app/ index.php $SCRIPT_URI = http://coaddons.sourceforge.net/caketest/app/; $SCRIPT_URL = /caketest/app/ $SERVER_ADDR= 10.4.1.114 $SERVER_ADMIN = [EMAIL PROTECTED] $SERVER_NAME= coaddons.sourceforge.net $SERVER_PORT= 80 $SERVER_SIGNATURE = Apache/1.3.33 Server at coaddons.sourceforge.net Port 80 $SERVER_SOFTWARE= Apache/1.3.33 (Unix) PHP/4.3.10 $UNIQUE_ID = RoSKQgoDAXIAAHFnd6w $GATEWAY_INTERFACE = CGI/1.1 $SERVER_PROTOCOL= HTTP/1.1 $REQUEST_METHOD = GET $QUERY_STRING = $REQUEST_URI= /caketest/app/ $SCRIPT_NAME= /caketest/app/index.php $PATH_TRANSLATED= /home/groups/c/co/coaddons/htdocs/caketest/app/ index.php $PHP_SELF = /caketest/app/index.php $argv = array() $argc = 0 $HTTP_POST_VARS = array() $_POST = array() $HTTP_GET_VARS = array() $_GET = array() $HTTP_COOKIE_VARS = array(username = puiHWbN0SE4=, __utma = 191645736.63192200.1180416069.1183001025.1183003493.18, __utmz = 191645736.1182832175.15.5.utmccn=(referral)|utmcsr=interactole.org| utmcct=/spaces/space.php|utmcmd=referral) $_COOKIE= array(username = puiHWbN0SE4=, __utma = 191645736.63192200.1180416069.1183001025.1183003493.18, __utmz = 191645736.1182832175.15.5.utmccn=(referral)|utmcsr=interactole.org| utmcct=/spaces/space.php|utmcmd=referral) $HTTP_SERVER_VARS = array(DOCUMENT_ROOT = /var/www, HTTP_ACCEPT = text/xml,application/xml,application/xhtml+xml,text/