Re: submitImage problem
Thanks Rich! That worked. How did you know the submitImage has been deprecated? I don't see it listed in the API (http://api.cakephp.org/ 1.2/class_form_helper.html#c3d45721c052080f91b4179c52db8bad). Thanks again. On Jan 5, 5:35 pm, chewie124 <[EMAIL PROTECTED]> wrote: > Try: > > submit('calendar.gif',array('id'=>'projstartdt')); ? > > > > submitImage has been deprecated with 6311. > > HTH! > Rich > > On Jan 5, 12:18 pm, pbland <[EMAIL PROTECTED]> wrote: > > > I just upgraded to 1.2.0.6311 and when I go to a view page in the > > browser, I get: > > >Fatal error: start-condition stack underflow in C:\Program Files > > \Apache Group\Apache2\htdocs\3Bids\cake\libs\debugger.php on line 332 > > > In the view, I have a form that displays a calendar image and I'm > > using this code to display it: > > > > > >submitImage('calendar.gif',array('id'=>'projstartdt')); ?> > > > If I remove this code, then the error goes away. Has something changed > > and the API documentation just not been updated because submitImage() > > is still in the API. > > > Thanks, > > Paul --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
submitImage problem
I just upgraded to 1.2.0.6311 and when I go to a view page in the browser, I get: Fatal error: start-condition stack underflow in C:\Program Files \Apache Group\Apache2\htdocs\3Bids\cake\libs\debugger.php on line 332 In the view, I have a form that displays a calendar image and I'm using this code to display it: submitImage('calendar.gif',array('id'=>'projstartdt')); ?> If I remove this code, then the error goes away. Has something changed and the API documentation just not been updated because submitImage() is still in the API. Thanks, Paul --~--~-~--~~~---~--~~ 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: View question
Is anyone displaying an image or some text after an input field in a view? And what happens if there's an error for this input field? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Comparing Dates
I want to compare 2 dates to make sure 1 date is older than the other. I believe I need to write my own comparison, but want to make sure there's nothing in Cake that already does this. I know date formats can be checked and I've seen a post saying the 'comparison' check is regex-based, which wouldn't help. Are my assumptions correct? Thanks, Paul --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
View question
I'm using 1.2 and I'm wondering how to fix a minor issue I have. I have a form with a date field and after the input box I'm displaying a calendar image that when clicked displays a date picker. This all works, but if I leave the field blank and hit submit I get the "This field cannot be left blank" message, which the DIV the message is in pushes the calendar image down to the next line. In searching this group I couldn't find any options to have the calendar image stay in place when there's an error message. How are people getting around this? Here's most of my view: create(array('action'=>'create','name'=>'form')); ?> ... Project Start Date*:input('Project.proj_start', array('div'=>false,'id'=>'ProjectProjStart','label'=>false,'size'=>15,'type'=>'text')); ? >submitImage('calendar.gif',array('id'=>'projstartdt')); ?> (mm/dd/ yy) ... submit('Save') ?> --~--~-~--~~~---~--~~ 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: Validation
Perfect, that worked! Thanks Abba. --~--~-~--~~~---~--~~ 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: Validation
I'm also having the same problem in 1.2.0.5427. If in my view I change form->password to form->input, then the error message displays. How are people validating passwords and displaying error messages? Thanks, Paul On Jul 18, 7:37 pm, citrus <[EMAIL PROTECTED]> wrote: > I also use Cake 1.2.0.5427alpha. > > Mypasswordvalidation doesn't work, either. Even if I try the > simplest rule ever: VALID_NOT_EMPTY. No error message is fired when I > leave thepasswordfield blank. > > On Jul 18, 4:58 pm, pihentagy <[EMAIL PROTECTED]> wrote: > > > Hi! > > > I've validation rules in my model: > > > var $validate= array( > > 'p4ssword' => array( > > 'length' => array('rule'=>array('minLength',8)), > > 'forbidden'=>array('rule'=>'notForbiddenPwd'), > > 'similar'=>array('rule'=>'notSimilarPwd'), > > ), > > 'confirm_p4ssword'=>array( > > 'match' => array('rule'=>'confirm_password') > > ), > > ); > > > and > > if($this->User->save($this->data, true, > > array('p4ssword'))) { > > in my controller. > > > Shouldn't this line fires validations? Putting log messages to the > > validation methods, I cannot see the those messages in the log, so > > something is wrong :( > > > Can anybody help figure out what's going on? > > > Using cake_1.2.0.5427alpha > > > thanks > > Gergo --~--~-~--~~~---~--~~ 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() not working
Adding return true did it!! THANK YOU! I really appreciate the help Jon and francky06l. On Aug 4, 1:02 pm, francky06l <[EMAIL PROTECTED]> wrote: > well spotted Jon :-) > > On Aug 4, 7:15 pm, "Jon Bennett" <[EMAIL PROTECTED]> wrote: > > > > - Comment your beforeSave function > > > - code $this->Account->save($this->data['Account'], null, false); > > > the problem lies with your beforeSave method, it doesn't return true, > > so Model->save() is never called. > > > add return true; to the bottom of your beforeSave method and it should be > > fine. > > > pretty sure the manual says about this. > > > hth > > > jon > > > -- > > > jon bennett > > 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: save() not working
I added a row in the table and added this in the controller: function create() { if (empty($this->data)) { // no error message $this->set('error', false); $dat = $this->Account->findAll(); pr($dat); // display the form to create account $this->render(); } else { ... } } and I see this when I open the page: Array ( [0] => Array ( [Account] => Array ( [id] => 1 [first_name] => Jane [last_name] => Doe [created] => 2007-08-04 10:55:40 [modified] => 2007-08-04 10:55:40 ) ) ) So I can connect to the database and retrieve data. Just can't save. ??? Thanks, Paul --~--~-~--~~~---~--~~ 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() not working
I do have some simple validation in the model: class Account extends AppModel { var $name = 'Account'; var $validate = array( 'first_name' => VALID_NOT_EMPTY, 'last_name' => VALID_NOT_EMPTY ); function beforeSave() { uses('sanitize'); $sanitize = new Sanitize(); // Sanitize incoming data $sanitize->clean($this->data); } } My database.php is standard: class DATABASE_CONFIG { var $default = array( 'driver' => 'mysql', 'connect' => 'mysql_connect', 'host' => 'localhost', 'login' => 'root', 'password' => 'password', 'database' => 'ccmdb', 'prefix' => ''); } I haven't retrieved data yet, as I first wanted to get the save to work. I will add some data and do a findAll() and see what happens. Thanks again. --~--~-~--~~~---~--~~ 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() not working
Thanks Jon Bennett and frankcy06l for the suggestions. I actually did have: if (empty($this->data)) { $this->render(); } I didn't include it in my post, as I just wanted to show what I thought was relevant. Francky06l, in looking at the examples, I don't believe it's required to list Form and Html in the controller. I did replace the with and I added in the controller: // SAVE UNSUCESSFUL // validate model errors $this->validateErrors($this->Account); // pass data back to view $this->set('data', $this->data); // render form again $this->render(); Unfortunately, it still doesn't work and I'm still not getting any error message. This is baffling. At first I had a lot of fields in the table, but I now have just first and last name to keep it simple. As the pr($this->data) shows, the Account array has data, but when the save() gets executed, I don't see any INSERT statement when I have debug set to 2. So it's like the save() doesn't even attempt to insert, but I don't know what else to check in my setup that could cause this. Thanks, Paul On Aug 4, 7:06 am, francky06l <[EMAIL PROTECTED]> wrote: > Few hints : > > - in your controller you do not mention the helpers : Form, Html but > maybe the are in app_controller ? > - try to replace the with > >create(array('action' => 'create')); ?> > > Hope this helps --~--~-~--~~~---~--~~ 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() not working
Yes, here's my view: Registration Information First Name*:input('Account.first_name', array('class'=>'required','label'=>false,'size'=>'30'));?> Last Name*:input('Account.last_name',array('label'=>false,'size'=>30)); ? > submit('Save') ?> *Required field --~--~-~--~~~---~--~~ 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() not working
Forgot to mention that I had cake 1.1 and it didn't work, so I upgraded to 1.2.0.5427 and still nothing. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
save() not working
I've spent the last 2 days trying to get my save() to work with no luck. I've reviewed everything. Twice. I've checked this group for things to look for and everything looks correct. I've printed my model and it has the data: Array ( [Account] => Array ( [first_name] => Joe [last_name] => Tester ) ) Here's my database schema: CREATE TABLE accounts ( id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, first_name VARCHAR(30) NOT NULL, last_name VARCHAR(50) NOT NULL, createdDATETIME DEFAULT NULL, modified DATETIME DEFAULT NULL) And my controller: class AccountsController extends AppController { var $name = 'Accounts'; function create() { pr($this-data); if($this->Account->save($this->data)) { echo 'save successful'; else echo 'no good'; } } I don't have any redirects. I have debug at 2 and I don't see any INSERT statement, nor any error messages. Does anyone have some other things for me to check? Thanks, Paul --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Validate using multiple error messages
I've followed this article: http://bakery.cakephp.org/articles/view/multiple-rules-of-validation-per-field-in-cakephp-1-2 but I'm getting this error: Warning: preg_match() expects parameter 1 to be string, array given in C:\Program Files\Apache Group\Apache2\htdocs\3Bids\cake\libs\model \model_php4.php on line 1367 Here's my model code: var $validate = array( 'firstname' => VALID_NOT_EMPTY, 'lastname' => VALID_NOT_EMPTY, 'username' => array('required' => VALID_NOT_EMPTY, 'length' => array('rule' => array('minLength', 6))), 'password' => VALID_NOT_EMPTY ); I've got v1.2 so I don't see what I'm doing wrong that the article isn't also doing. Anyone? --~--~-~--~~~---~--~~ 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: CSS not working
Pablo, Great, that worked! Thanks for the help. Can you tell me where $html- >css() is described in the Manual? I looked on the Helper page and I see mention of $html functions, but it mentions 4 parms for the css function, so I don't know if this is the correct one. 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 -~--~~~~--~~--~--~---
CSS not working
I'm having a problem with my CSS file not being found or being applied for a view that is initiated from a link in index.php . Here's how I have my app configured: In routes.php I have "/" mapped to: array('controller' => 'accounts', 'action' => 'index') When I got to the index.thtml page, the page loads and the CSS styles (from the in default.thtml) are applied. In index.thtml there is a link: $html->link("Login to your account","/ accounts/login/"). When I click the link, the login.thtml page in my view folder loads, but now the CSS styles are not applied. However, when I view the source, I see . So I'm the style.css file is not being found, but I don't understand why. Any help would be appreciated. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Switching between databases
In the database.php file, it says "you can specify multiple configurations for production, development and testing." I'm not seeing how easily it is to switch from doing local development on a local database and then moving to a live database. I know you can change databases in the controller through the $useDbConfig, but then this requires changing each controller when you're ready to go live. I'm missing something. Anyone willing to share how they setup their development and production db configs? Thanks, Paul --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---