Email Component: I see html email as source code in Squirrel mail web client
When I send Email via the Email Component as Both i.e. html and text. It appears fine in my outlook and also yahoo and I think Gmail too but when I check it in Squirrel Mail webmail interface, it shows the text portion first, then the html source code underneath. This is pretty embarrassing as most of my clients will be checking via webmail. What can I do to prevent this, please. Thank You. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Validate CC field
Sorry, I thought you wanted to save the CC field :) You can instantiate the Validation class yourself and use the email validation method to validate each of your CC addresses. See http://api12.cakephp.org/class/validation#method-Validationemail for the Validation class source. Should someone else have a better solution, please tell us :) Enjoy, John On Apr 16, 8:57 am, Henrik Gemal henrikge...@gmail.com wrote: Is there a way to manually call the validation checks? So psedo code like: foreach ($ccs as $cc) $validate-email($cc) ? [snip] Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Auth Component: Allow action in a controller but disallow it in another
Hello, Please I have an action named referrals, I wish to allow this action in the guestscontroller without authentication but I have a similar action in the userscontroller and the staffscontroller. I DO NOT wish to change the action (vis-a-vis url format) name for LEGACY reasons. The Auth component keeps allowing my users and staffs referral pages access without authentication. This is understandable though. The question now is how do I achieve this feat? Thank You. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Using Session class and Ajax
Please can anyone provide any advice at all? I'm searching through the core libs trying to figure out where the Config data is being written into the Session. When I do Session-error() I consistently get Config doesn't exist meaning I think it doesn't have the config variables telling it what type of session storage to use (php, cake, database) and what location to go in along with the other config variables. Thanks! Will Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: News with Comments - how to sort by comments count?
This looks great, but unfortunately seems like not working here. I altered my Comment model: var $belongsTo = array( 'News' = array( 'className' = 'News', 'foreignKey' = 'news_id', 'conditions' = '', 'fields' = '', 'order' = '', 'counterCache' = true )); Then in the news model I do finding by: function get_last_paged($page) { $offset = ($page - 1) * 5; $result = self::find('all', array('limit' = 5, 'offset' = $offset)); return $result; } function get_last_commented($page) { $offset = ($page - 1) * 5; $result = self::find('all', array('limit' = 5, 'offset' = $offset, 'order' = 'News.comment_count DESC')); return $result; } The last_paged function works, the commenting - doesn't. Looking into the phpmyadmin seems like no changes are done. Is there anything else to do for the comments? On Apr 14, 12:02 pm, WebbedIT p...@webbedit.co.uk wrote: I would recommend using counterCache if regularly sorting data by count, it's much more efficient hence why it;s included in Cake's automagic. http://book.cakephp.org/view/816/counterCache-Cache-your-count HTH Paul Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
refer one related models data in a view of second model?
Hi, I need a bit of help using $this or findfirst. I have a model 'requests' containig date,time, customer etc. requests $hasOne booking I have a model 'booking', $belongsTo requests I modded the add function of bookings to get some parameters i.e. request_id to pass it to my booking-form. Now I would like to echo the request data belonging to the booking - inside the bookingview to gice a more detailed look. My idea to use $this-request-date1 and $this-request-date2, $this- request-detail3 did not work. So I could need a short help how to refer my data from other models with one fitting information (unique id or a string) and display id inside the view. Ho to show data of the request model in the bokkings views? Thank you. Michael Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: XML Output
Any takers please? Jeremy Burns jeremybu...@me.com On 15 Apr 2010, at 16:45, Jeremy Burns wrote: I have a controller function that calls a model function that generates a well formed array. I want to convert the array to XML and submit it to a web service. The array is in the same shape as the example in the guide: Array ( [Baker] = Array ( [0] = Array ( [name] = The Baker [weight] = heavy ) [1] = Array ( [name] = The Cook [weight] = light-weight ) ) ) The guide then tells me to: pr($xml-serialize($data)); This isn't rendering anything either via a view or debugging in the controller/model. I have declared the Xml helper in the controller. What am I doing wrong? Secondly, whilst it's useful to push it to a view for testing purposes I really want to do something with it in the controller. How do I get an XML file there? Are there any good tutorials anywhere? (!.3 RC3). Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en To unsubscribe, reply using remove me as the subject. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: refer one related models data in a view of second model?
I also tried adding var $uses = array('customer','request'); in the bookings controller. If I do so I get an error inside my find commands: if ($rid) { $customers = $this-Booking-Customer- find('list',array('conditions' = array('Customer.id' = $cid))); } else{ $customers = $this-Booking-Customer-find('list'); $rid is the request id passed from request index list to the add function of bookings $cid is the customer id passed from request index list to the add function of bookings error: Notice (8): Undefined property: BookingsController::$Booking [APP \controllers\bookings_controller.php, line 31] Code | Context } if ($rid) {$customers = $this-Booking-Customer- find('list',array('conditions' = array('Customer.id' = $cid)));} $rid= 15 $cid= 12 $nid= R-1271-3641-04 BookingsController::add() - APP\controllers\bookings_controller.php, line 31 Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 202 Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 170 [main] - APP\webroot\index.php, line 83 Notice (8): Trying to get property of non-object [APP\controllers \bookings_controller.php, line 31] Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: refer one related models data in a view of second model?
Have a read of this thread...might help. http://groups.google.com/group/cake-php/browse_thread/thread/e01fd12a9d986d4/9fe7a541c10fc919?lnk=gstq=Manipulating+Data+Based+on+Non+Related+Model+Data#9fe7a541c10fc919 Jeremy Burns jeremybu...@me.com (Skype) +44 208 123 3822 (jeremy_burns) (m) +44 7973 481949 (h) +44 208 530 7573 On 16 Apr 2010, at 09:44, mivogt-LU wrote: I also tried adding var $uses = array('customer','request'); in the bookings controller. If I do so I get an error inside my find commands: if ($rid) { $customers = $this-Booking-Customer- find('list',array('conditions' = array('Customer.id' = $cid))); } else{ $customers = $this-Booking-Customer-find('list'); $rid is the request id passed from request index list to the add function of bookings $cid is the customer id passed from request index list to the add function of bookings error: Notice (8): Undefined property: BookingsController::$Booking [APP \controllers\bookings_controller.php, line 31] Code | Context } if ($rid) {$customers = $this-Booking-Customer- find('list',array('conditions' = array('Customer.id' = $cid)));} $rid = 15 $cid = 12 $nid = R-1271-3641-04 BookingsController::add() - APP\controllers\bookings_controller.php, line 31 Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 202 Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 170 [main] - APP\webroot\index.php, line 83 Notice (8): Trying to get property of non-object [APP\controllers \bookings_controller.php, line 31] Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: refer one related models data in a view of second model?
HI Mr Burns (sorry could not resist, just like the simpson now and then..) ;) thanks I got it working. The lesson I learnd: 1) if any data of a related model is used/shown in a view it is accessable 2) there is no need to prepare this in the controller if it is only needed to be displays in a view 3) inside a view it is a question of using the right array index In my case I tried to access the array $customers using the Index ['phone'] wich was a fault. I got (using debug $customers in the view instead of the controller) that all data is still available inside the view. Inside the view with right handling of the $customers array I got all I need. $MyCustomerPhoneNumer = $customers['customer']['phone']; works fine. So anybody later then me looking up this thread: MIND THE INDEX of the damned arrays 1st and 2nd dimensions. Thanks again. Michael cake 1.3RCx On 16 Apr., 10:49, Jeremy Burns jeremybu...@me.com wrote: Have a read of this thread...might help. http://groups.google.com/group/cake-php/browse_thread/thread/e01fd12a... Jeremy Burns jeremybu...@me.com (Skype) +44 208 123 3822 (jeremy_burns) (m) +44 7973 481949 (h) +44 208 530 7573 On 16 Apr 2010, at 09:44, mivogt-LU wrote: I also tried adding var $uses = array('customer','request'); in the bookings controller. If I do so I get an error inside my find commands: if ($rid) { $customers = $this-Booking-Customer- find('list',array('conditions' = array('Customer.id' = $cid))); } else { $customers = $this-Booking-Customer-find('list'); $rid is the request id passed from request index list to the add function of bookings $cid is the customer id passed from request index list to the add function of bookings error: Notice (8): Undefined property: BookingsController::$Booking [APP \controllers\bookings_controller.php, line 31] Code | Context } if ($rid) { $customers = $this-Booking-Customer- find('list',array('conditions' = array('Customer.id' = $cid))); } $rid = 15 $cid = 12 $nid = R-1271-3641-04 BookingsController::add() - APP\controllers\bookings_controller.php, line 31 Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 202 Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 170 [main] - APP\webroot\index.php, line 83 Notice (8): Trying to get property of non-object [APP\controllers \bookings_controller.php, line 31] Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Internet Explorer error! (Want to show element in a table cell) :-(
Another addition: When i only insert the image, without the $html-link, it works in internet explorer 8. [code works but without link] ?php echo $html-image(edit.png, array(alt = Editieren)); ? [\code] Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Internet Explorer error! (Want to show element in a table cell) :-(
Do you have some specific styling for IE? Try also just to write a dummy link around your image, just to see if it makes a difference! [code] ?php echo 'a href=#'.$html-image(edit.png, array(alt = Editieren)).'/a'; ? [\code] Enjoy, John On Apr 16, 12:38 pm, sebb86 kahlc...@googlemail.com wrote: Another addition: When i only insert the image, without the $html-link, it works in internet explorer 8. [code works but without link] ?php echo $html-image(edit.png, array(alt = Editieren)); ? [\code] Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: refer one related models data in a view of second model?
Excellent, Smithers. Jeremy Burns jeremybu...@me.com On 16 Apr 2010, at 10:20, mivogt-LU wrote: HI Mr Burns (sorry could not resist, just like the simpson now and then..) ;) thanks I got it working. The lesson I learnd: 1) if any data of a related model is used/shown in a view it is accessable 2) there is no need to prepare this in the controller if it is only needed to be displays in a view 3) inside a view it is a question of using the right array index In my case I tried to access the array $customers using the Index ['phone'] wich was a fault. I got (using debug $customers in the view instead of the controller) that all data is still available inside the view. Inside the view with right handling of the $customers array I got all I need. $MyCustomerPhoneNumer = $customers['customer']['phone']; works fine. So anybody later then me looking up this thread: MIND THE INDEX of the damned arrays 1st and 2nd dimensions. Thanks again. Michael cake 1.3RCx On 16 Apr., 10:49, Jeremy Burns jeremybu...@me.com wrote: Have a read of this thread...might help. http://groups.google.com/group/cake-php/browse_thread/thread/e01fd12a... Jeremy Burns jeremybu...@me.com (Skype) +44 208 123 3822 (jeremy_burns) (m) +44 7973 481949 (h) +44 208 530 7573 On 16 Apr 2010, at 09:44, mivogt-LU wrote: I also tried adding var $uses = array('customer','request'); in the bookings controller. If I do so I get an error inside my find commands: if ($rid) { $customers = $this-Booking-Customer- find('list',array('conditions' = array('Customer.id' = $cid))); } else{ $customers = $this-Booking-Customer-find('list'); $rid is the request id passed from request index list to the add function of bookings $cid is the customer id passed from request index list to the add function of bookings error: Notice (8): Undefined property: BookingsController::$Booking [APP \controllers\bookings_controller.php, line 31] Code | Context } if ($rid) {$customers = $this-Booking-Customer- find('list',array('conditions' = array('Customer.id' = $cid)));} $rid = 15 $cid = 12 $nid = R-1271-3641-04 BookingsController::add() - APP\controllers\bookings_controller.php, line 31 Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 202 Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 170 [main] - APP\webroot\index.php, line 83 Notice (8): Trying to get property of non-object [APP\controllers \bookings_controller.php, line 31] Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Auth Component: Allow action in a controller but disallow it in another
Take a look at the message: http://groups.google.com/group/cake-php/browse_thread/thread/e53fafc5c33dbe6a/543251f6349d373b?#543251f6349d373b which is not about the same topic, but Crickets example and explanation is certainly related to your issue. Enjoy, John On Apr 16, 10:28 am, Prof. No Time libertylivingst...@gmail.com wrote: Hello, Please I have an action named referrals, I wish to allow this action in the guestscontroller without authentication but I have a similar action in the userscontroller and the staffscontroller. I DO NOT wish to change the action (vis-a-vis url format) name for LEGACY reasons. The Auth component keeps allowing my users and staffs referral pages access without authentication. This is understandable though. The question now is how do I achieve this feat? Thank You. Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Using Button to submit the form
Hi all, I have Back and Next as two buttons in my view file. Which are used for the navigation between the pages. Now when i click on Next button It should do the page validation also. I have put the code below. Please help me. In campaign.php model page var $validate = array( 'brand' = array( 'rule' = array('minLength', 1), 'required' = true, 'allowEmpty' = false, 'message' = 'Please enter a value for the Brand field' ), 'product' = array( 'rule' = array('minLength', 1), 'required' = true, 'allowEmpty' = false, 'message' = 'Please enter a value for the Product field' ), 'media' = array( 'rule' = array('minLength', 1), 'required' = true, 'allowEmpty' = false, 'message' = 'Please ensure you have selected Activation Media for this promotion' ), ); In the controller page function step_two(){ //get all data from agencies table $agencies = $this-Agencie-find('all', array('fields' = 'Agencie.name')); $this-set('agencies',$agencies); //get all data from media table $media = $this-Media-find('all'); $this-set('media',$media); } In the view file !-- in header part -- ?php // validation error display if($form-isFieldError('User.brand')) e($form-error ('User.brand', null, array('class' = 'failure'))); else if($form-isFieldError('User.product')) e($form-error ('User.product', null, array('class' = 'failure'))); else if($form-isFieldError('User.media')) e($form-error ('User.media', null, array('class' = 'failure'))); ? . . . ?php echo $form-create('Campaign', array('action' = 'step_two'));? . . . td style=width:80% align=right colspan=2 ?php $link = $this-webroot . 'campaigns/step_one'; echo $form-button(' Back', array('onclick' = location.href='. $link.')); $link = $this-webroot . 'campaigns/step_three'; echo $form-button('Next ', array('onclick' = location.href='. $link.'));? /td Thanks in Advance Ambika Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Internet Explorer error! (Want to show element in a table cell) :-(
Addition: I'm really sorry but i forgot my self defined css... :( So this works for Firefox: [code] ?php echo $html-link('Edit', array(controller = 'dns_names', action = edit, $dns_name['Dnsname']['id']), array('class' = 'edit', title = Editieren), null, false); ? [/code] And when i remove: array('class' = 'edit', title = Editieren) it works also for the internet explorer, but without image. So i think this is the problem. Is there maybe a syntax error? [this code works, but without the image] ?php echo $html-link('Edit', array(controller = 'dns_names', action = edit, $dns_name['Dnsname']['id']), null, false); ? [/code] [my css code] a.edit { text-indent:-5000px; display:inline-block; width:24px; height:29px; background:transparent url(/img/edit.png) no-repeat 0 0; } a.edit:hover { background-position:0px 5px; } [/code] It would be very very very brilliant if someone could solve this. I spend so much hours on this :( Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
FormHelper: disable a field for input / set viewonly?
I am passing some data from controller to my view i.e. a timestamp as process-id-number (better readable using php wordwrap function..) I want the number to be displayed in a form-field but also would like to set this field to be disabled for changing. $options does not look to have a disanle function. Is there a way to do so with cake? Thanks Michael Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: AppController being cached?
The file is in the correct location, beside the app_model.php, which has no problem. Besides, there are some logic inside the AppController like components initialization and some shared logic that work. And if I download the file from FTP or open it through SSH, I can see the changes I made. But, again, the changes are not reflected on the app. On Friday, April 16, 2010, Dr. Loboto drlob...@gmail.com wrote: You may edit file in wrong location. You may have some PHP opcode cacher in action. BTW, app_controller is not necessary unless you call methods defined there. So if there is nothing critical and file is not loaded because of wrong rights it won't be fatal. On Apr 16, 7:47 am, Lucca Mordente luccamorde...@gmail.com wrote: That's the point. No change is being reflected. And the website continues to work even when the app_controller.php file is deleted, as if it was there. Lucca Mordente Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com for more options, visit this group at http://groups.google.com/group/cake-php?hl=en -- Lucca Mordente Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Sending view parameters to javascript function
Hi All, I want to send the post data to a javascript function. I have put the code below . Please help name view.ctp If I am just calling the js function it works. . function validate(){ window.alert(It's working); } ?php echo $form-create('User', array('action' ='login')); echo $form-input(username); echo $form- submit('signin.gif',array('width'=100,'height'=22,'onclick'='validate()')); echo $form-end(); ? But when I am trying to do like the following it wont work function validate() { var username=document.User.username.value; window.alert(username); } ?php echo $form-create('User', array('action' ='login')); echo $form-input(username); echo $form-submit('signin.gif',array('width'=100, 'height'=22,'onclick'='validate()')); echo $form-end(); ? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Internet Explorer error! (Want to show element in a table cell) :-(
On Apr 16, 6:13 am, sebb86 kahlc...@googlemail.com wrote: Addition: I'm really sorry but i forgot my self defined css... :( So this works for Firefox: [code] ?php echo $html-link('Edit', array(controller = 'dns_names', action = edit, $dns_name['Dnsname']['id']), array('class' = 'edit', title = Editieren), null, false); ? [/code] And when i remove: array('class' = 'edit', title = Editieren) it works also for the internet explorer, but without image. So i think this is the problem. Is there maybe a syntax error? [this code works, but without the image] ?php echo $html-link('Edit', array(controller = 'dns_names', action = edit, $dns_name['Dnsname']['id']), null, false); ? [/code] [my css code] a.edit { text-indent:-5000px; display:inline-block; width:24px; height:29px; background:transparent url(/img/edit.png) no-repeat 0 0; } a.edit:hover { background-position:0px 5px;} [/code] Ah, image replacement. You definitely need to pay attention to what works and what doesn't for IE. Anyway, if you're going to use that, you shouldn't be including the image in the HTML. Try this: $html-link( 'Edit', array('controller' = 'dns_names', 'action' = 'edit', $dns_name['Dnsname']['id']), array('class' = 'edit', title = Editieren) ); a.edit { width:24px; height: 29px; padding-top: 29px; overflow: hidden; /*Hide the text*/ background:transparent url(/img/edit.png) no-repeat 0 0; color: #FFF; /* to hide when IE screws up and shows underlying text */ voice-family: \}\; voice-family: inherit; height: 0; } htmlbody a.edit { height: 0; } a.edit:hover { background-position:0px 5px; } Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: CakePHP Auth Component cannot remember url before authentication
On Apr 16, 1:40 am, Prof. No Time libertylivingst...@gmail.com wrote: In the cook book, we are told that the auth component uses the session component to remember the url the user intended to visit and hence when authenticated, automatically takes the user there. However, this DOES NOT WORK for me (cake 1.2.5). What could be the problem? What does your AppController::beforeFilter() look like? Specifically, do you have $this-Auth-autoRedirect = false? Do you have any code in UsersController::login() or is it empty? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Sending view parameters to javascript function
If it's your Javascript that's not working I would use: function validate() { var username=Form.Element.getValue('UserUsername'); window.alert(username); } - Ed On Fri, Apr 16, 2010 at 6:46 AM, Ambika Kulkarni ambikakulkarn...@gmail.com wrote: Hi All, I want to send the post data to a javascript function. I have put the code below . Please help name view.ctp If I am just calling the js function it works. . function validate(){ window.alert(It's working); } ?php echo $form-create('User', array('action' ='login')); echo $form-input(username); echo $form- submit('signin.gif',array('width'=100,'height'=22,'onclick'='validate()')); echo $form-end(); ? But when I am trying to do like the following it wont work function validate() { var username=document.User.username.value; window.alert(username); } ?php echo $form-create('User', array('action' ='login')); echo $form-input(username); echo $form-submit('signin.gif',array('width'=100, 'height'=22,'onclick'='validate()')); echo $form-end(); ? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: FormHelper: disable a field for input / set viewonly?
On Apr 16, 6:18 am, mivogt-LU c...@mivogt.net wrote: I am passing some data from controller to my view i.e. a timestamp as process-id-number (better readable using php wordwrap function..) I want the number to be displayed in a form-field but also would like to set this field to be disabled for changing. $options does not look to have a disanle function. Is there a way to do so with cake? You have several options. The simplest would be to just echo the value. Does it really need to be a form input? But, if you must pass the value back to your controller: $form-hidden('the_name', array('value' = $this-data['...'])) echo $this-data['...']; or: input type=text name=the_name value=?= $this-data['whatever'] ['whatever'] ? disabled=disabled / Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Using Session class and Ajax
On Apr 16, 3:37 am, Will Poillion lorew...@gmail.com wrote: Please can anyone provide any advice at all? I'm searching through the core libs trying to figure out where the Config data is being written into the Session. When I do Session-error() I consistently get Config doesn't exist meaning I think it doesn't have the config variables telling it what type of session storage to use (php, cake, database) and what location to go in along with the other config variables. What version are you running? I'm on 1.2.6 and don't see that error string in the CakeSession class nor the SessionHelper or SessionComponent. But, if you're using another version, track down the string. It'll probably give you a clue. I know that I've seen similar problems reported but I can't remember what the fix is. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: FormHelper: disable a field for input / set viewonly?
::solved::solved::solved ok thank you cricket, so I understand there is only the noncake way to do it. using the usual html form syntax or, as you suggested - using the echo instead of a form field. might be I need to look to choos the right css class to keep the look/ fontsize in that case. ::solved::solved::solved On 16 Apr., 13:03, cricket zijn.digi...@gmail.com wrote: On Apr 16, 6:18 am, mivogt-LU c...@mivogt.net wrote: I am passing some data from controller to my view i.e. a timestamp as process-id-number (better readable using php wordwrap function..) I want the number to be displayed in a form-field but also would like to set this field to be disabled for changing. $options does not look to have a disanle function. Is there a way to do so with cake? You have several options. The simplest would be to just echo the value. Does it really need to be a form input? But, if you must pass the value back to your controller: $form-hidden('the_name', array('value' = $this-data['...'])) echo $this-data['...']; or: input type=text name=the_name value=?= $this-data['whatever'] ['whatever'] ? disabled=disabled / Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Internet Explorer error! (Want to show element in a table cell) :-(
cricket Also thanks to you. It dont works in both browsers. Dont know why. Anyway... i decided that i dont use CSS for this. I got it working so far but i still have one problem. [this code works (without the CSS class, but its okay] ?php echo $html-image(edit.png, array(alt = Editieren, 'url' = array('controller' = 'dns_names', 'action' = 'edit', $dns_name['DnsName']['id']))); ? [/code] The last problem: I want to use the same source code for me delete button. But how can i include my confirm message in the following code: [delete code] ?php echo $html-image(delete.png, array(alt = Delete, 'url' = array('controller' = 'dns_names', 'action' = 'delete', $dns_name['DnsName']['id']))); ? [/code] [code confirm message] sprintf(__($deleteQuestion, true), $dns_name['DnsName']['id'] [/code] Thanks a lot to all helpers!!! :-) Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: AppController being cached?
On Apr 16, 6:44 am, Lucca Mordente luccamorde...@gmail.com wrote: The file is in the correct location, beside the app_model.php, which has no problem. Besides, there are some logic inside the AppController like components initialization and some shared logic that work. And if I download the file from FTP or open it through SSH, I can see the changes I made. But, again, the changes are not reflected on the app. Is there any code at all in AppController that you know is running? Maybe the nme is incorrect. It should be: class AppController extends Controller ... and file name app_controller.php Or, maybe it is being evaluated, but there's something else going on. Try this: function beforeFilter() { die('yep, this is the one'); } And make sure you call parent::beforeFilter() if you override that method in other controllers. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
avoiding add function with no parameters?
HI there, I did a mod to my add function in a model/controller. My model-1 view now has a button calling the add function of model-2 sending some parameters to be shown in the add view. Now I want the model-2 to disable any add function inside the conroller if no data was passed from model-1 (or via url). Is there a best practise solution or is it ok just to do something like the check done for id when deleting a record?: function edit($id = null) { if (!$id empty($this-data)) { $this-Session-setFlash(sprintf(__('Invalid %s', true), 'booking')); $this-redirect(array('action' = 'index')); Additional question I want to redirect to the calling model-1. Hot to call model-1-index instead of model-2-index as shown? Thanks Michael Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Internet Explorer error! (Want to show element in a table cell) :-(
On Apr 16, 7:20 am, sebb86 kahlc...@googlemail.com wrote: cricket Also thanks to you. It dont works in both browsers. Dont know why. Anyway... i decided that i dont use CSS for this. I got it working so far but i still have one problem. [this code works (without the CSS class, but its okay] ?php echo $html-image(edit.png, array(alt = Editieren, 'url' = array('controller' = 'dns_names', 'action' = 'edit', $dns_name['DnsName']['id']))); ? [/code] The last problem: I want to use the same source code for me delete button. But how can i include my confirm message in the following code: [delete code] ?php echo $html-image(delete.png, array(alt = Delete, 'url' = array('controller' = 'dns_names', 'action' = 'delete', $dns_name['DnsName']['id']))); ? [/code] [code confirm message] sprintf(__($deleteQuestion, true), $dns_name['DnsName']['id'] [/code] But now you don't have a link. Go back to what you had before, ie. $html-link($html-image(...), ...) And remove the CSS rules. I never use Cake's $confirmMessage myself but look here: http://api.cakephp.org/class/html-helper#method-HtmlHelperlink Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: view as downloadable text/plain
Because the View class uses output buffering. Have a look at MediaView instead: Thank you; but I am afraid I did not figure out how this helps me MediaView Summary: Methods to display or download any type of file I do not want to display or download a file as there exists no file. The content that I want to display as plain/text (perhaps offer a download dialog, but not necessarily) is created at runtime and needs a lot of methods from helpers, so I would like to create the output in the view and not create a file from the controller. In the class info are a lot of properties and methods that relate to views, so I think MediaView is able to do what I want, but I have no idea how to implement it. Could someone give me another hint? Thanks! M. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Using Button to submit the form
On Apr 16, 5:57 am, Ambika Kulkarni ambikakulkarn...@gmail.com wrote: Hi all, I have Back and Next as two buttons in my view file. Which are used for the navigation between the pages. Now when i click on Next button It should do the page validation also. I have put the code below. Please help me. I'm not 100% sure but I think what you need to do is create 2 forms, one for 'back' and the other for 'next. The 2nd one is this page's form, as normal. The 'back' one, though, consists only of hidden inputs with the values submitted from the previous step. Meaning, you'll need to set() some view vars of the latest submitted data for each next view. It might be easier in this case to not use FormHelper for the 'back' form and instead use regualr HTML. Just ensure that you name the elements correctly, ie name=data['model']['field'] value=? = $some_var ? Obviously, you'll need to also ensure you're not saving data twice. So, instead of only doing if(empty($this-data)) you might do something like: if (empty($this-data) !isset($this-data['ModelName']['id'])) { /// save the data and redirect to next step } // show the form Or something like that. I know there was a Wizard component or helper or somesuch at the Bakery a long time ago. You might want to have a look at that for ideas. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: avoiding add function with no parameters?
On Apr 16, 7:32 am, mivogt-LU c...@mivogt.net wrote: HI there, I did a mod to my add function in a model/controller. My model-1 view now has a button calling the add function of model-2 sending some parameters to be shown in the add view. Now I want the model-2 to disable any add function inside the conroller if no data was passed from model-1 (or via url). Is there a best practise solution or is it ok just to do something like the check done for id when deleting a record?: function edit($id = null) { if (!$id empty($this-data)) { $this-Session-setFlash(sprintf(__('Invalid %s', true), 'booking')); $this-redirect(array('action' = 'index')); That would work except that you're expecting that $id will always be present in the URL. So you'll need to make sure it is (in links or form actions). Or, you could change it to: if (!$id || empty($this-data['ModelName'] ['some_var_from_other_view'])) But that would still allow someone to access this method without going to the other view. So, maybe: if (empty($this-data['ModelName']['some_var_from_other_view'])) That's edit() not add() btw (not that it matters). Additional question I want to redirect to the calling model-1. Hot to call model-1-index instead of model-2-index as shown? $this-redirect(array('controller' = 'the_other_controller', 'action' = 'index')); Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: view as downloadable text/plain
On Apr 16, 7:37 am, Melanie Sommer melanie-som...@mailinator.com wrote: Because the View class uses output buffering. Have a look at MediaView instead: Thank you; but I am afraid I did not figure out how this helps me MediaView Summary: Methods to display or download any type of file I do not want to display or download a file as there exists no file. The content that I want to display as plain/text (perhaps offer a download dialog, but not necessarily) is created at runtime and needs a lot of methods from helpers, so I would like to create the output in the view and not create a file from the controller. In the class info are a lot of properties and methods that relate to views, so I think MediaView is able to do what I want, but I have no idea how to implement it. Could someone give me another hint? I just wrote a quick PlaintextHelper (3 minutes!) based on the CsvHelper I'm already using. Check it out here: http://pastebin.com/u46cWX7T Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Strange output of Session-flash() method
Hi, I am new to this fora. I have encounted a possible bug in the CakePHP framework or possible made a odd mistake myself. Any way, every time I send messages to the view through the Session-setFlash() method the Session-flash() method output a 1 after the div elements. Like the example below: div id=flashMessage class=messageThis is a message.../div1 I thought in the begining that I had done something wrong, since I tend to be a bit to fast (and also sloppy) on the keyboard. But after been able to reproduce this error on different servers and with a clean installation of CakePHP, I can not understand what I possible can be doing wrong. This is my controller code: ?php class PagesController extends AppController { var $uses = array(); function index() { $this-Session-setFlash('This is a message...'); } } And my default.ctp code: ?php echo $session-flash(); ? ?php echo $content_for_layout; ? As you can see my application has no functionality and the error occurs anyway. By the way, I have tried to search for this bug in Google but it is quite hard to find anything relevant when the searching criteria is pretty much 1. ;) Thanks in advance for any help -Kjetil Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Strange output of Session-flash() method
Which version are you on? If it's 1.2.x, try: $session-flash(); // no echo If it's 1.3, you use echo. Jeremy Burns jeremybu...@me.com On 16 Apr 2010, at 00:36, kjetiltuft wrote: Hi, I am new to this fora. I have encounted a possible bug in the CakePHP framework or possible made a odd mistake myself. Any way, every time I send messages to the view through the Session-setFlash() method the Session-flash() method output a 1 after the div elements. Like the example below: div id=flashMessage class=messageThis is a message.../div1 I thought in the begining that I had done something wrong, since I tend to be a bit to fast (and also sloppy) on the keyboard. But after been able to reproduce this error on different servers and with a clean installation of CakePHP, I can not understand what I possible can be doing wrong. This is my controller code: ?php class PagesController extends AppController { var $uses = array(); function index() { $this-Session-setFlash('This is a message...'); } } And my default.ctp code: ?php echo $session-flash(); ? ?php echo $content_for_layout; ? As you can see my application has no functionality and the error occurs anyway. By the way, I have tried to search for this bug in Google but it is quite hard to find anything relevant when the searching criteria is pretty much 1. ;) Thanks in advance for any help -Kjetil Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Internet Explorer error! (Want to show element in a table cell) :-(
The solution was an empty array [dynamic code] ?php echo $html-link($html-image(delete.png, array(alt = Löschen)), array(controller = $contr, action = delete, $row[$class]['id']), array(), sprintf(__($deleteQuestion, true), $row[$class]['id']), null, false); ? [/code] Really thanks a lot to all helpers!! thanks thanks thanks :-) Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Sending view parameters to javascript function
alert(I am in hello function+Form.Element.getValue('Campaign.Name')); Its giving error. element is null On Apr 16, 3:57 pm, Ed Propsner crotchf...@gmail.com wrote: If it's your Javascript that's not working I would use: function validate() { var username=Form.Element.getValue('UserUsername'); window.alert(username); } - Ed On Fri, Apr 16, 2010 at 6:46 AM, Ambika Kulkarni ambikakulkarn...@gmail.com wrote: Hi All, I want to send the post data to a javascript function. I have put the code below . Please help name view.ctp If I am just calling the js function it works. . function validate() { window.alert(It's working); } ?php echo $form-create('User', array('action' ='login')); echo $form-input(username); echo $form- submit('signin.gif',array('width'=100,'height'=22,'onclick'='validate()')); echo $form-end(); ? But when I am trying to do like the following it wont work function validate() { var username=document.User.username.value; window.alert(username); } ?php echo $form-create('User', array('action' ='login')); echo $form-input(username); echo $form-submit('signin.gif',array('width'=100, 'height'=22,'onclick'='validate()')); echo $form-end(); ? Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Sending view parameters to javascript function
alert(I am in hello function+Form.Element.getValue('Campaign.Name')); I am getting error. element null On Apr 16, 3:57 pm, Ed Propsner crotchf...@gmail.com wrote: If it's your Javascript that's not working I would use: function validate() { var username=Form.Element.getValue('UserUsername'); window.alert(username); } - Ed On Fri, Apr 16, 2010 at 6:46 AM, Ambika Kulkarni ambikakulkarn...@gmail.com wrote: Hi All, I want to send the post data to a javascript function. I have put the code below . Please help name view.ctp If I am just calling the js function it works. . function validate() { window.alert(It's working); } ?php echo $form-create('User', array('action' ='login')); echo $form-input(username); echo $form- submit('signin.gif',array('width'=100,'height'=22,'onclick'='validate()')); echo $form-end(); ? But when I am trying to do like the following it wont work function validate() { var username=document.User.username.value; window.alert(username); } ?php echo $form-create('User', array('action' ='login')); echo $form-input(username); echo $form-submit('signin.gif',array('width'=100, 'height'=22,'onclick'='validate()')); echo $form-end(); ? Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: AppController being cached?
Every piece of code is being executed. But whatever I add to it, don't have effects. I tried die, debug and, as I said, neither invalidating the code nor deleting the file affects the app. Lucca Mordente On Fri, Apr 16, 2010 at 8:21 AM, cricket zijn.digi...@gmail.com wrote: On Apr 16, 6:44 am, Lucca Mordente luccamorde...@gmail.com wrote: The file is in the correct location, beside the app_model.php, which has no problem. Besides, there are some logic inside the AppController like components initialization and some shared logic that work. And if I download the file from FTP or open it through SSH, I can see the changes I made. But, again, the changes are not reflected on the app. Is there any code at all in AppController that you know is running? Maybe the nme is incorrect. It should be: class AppController extends Controller ... and file name app_controller.php Or, maybe it is being evaluated, but there's something else going on. Try this: function beforeFilter() { die('yep, this is the one'); } And make sure you call parent::beforeFilter() if you override that method in other controllers. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: AppController being cached?
Are you uploading it to the right directory? Correct naming, etc. On Apr 15, 5:47 pm, Lucca Mordente luccamorde...@gmail.com wrote: That's the point. No change is being reflected. And the website continues to work even when the app_controller.php file is deleted, as if it was there. Lucca Mordente On Thu, Apr 15, 2010 at 9:43 PM, cricket zijn.digi...@gmail.com wrote: On Apr 15, 7:30 pm, Lucca Mordente luccamorde...@gmail.com wrote: Up!! This is a problem in an operating website in which I have to make some changes. Any ideas about what can be happening? What changes to AppController are you making? Perhaps there's another explanation than cache. Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Get params unicode error
My function function view($slug=null){ echo $slug; } enter url: - products/view/университетски or: - products/view/%d1%83%d0%bd %d0%b8%d0%b2%d0%b5%d1%80%d1%81%d0%b8%d1%82%d0%b5%d1%82%d1%81%d0%ba %d0%b8 pr(urlencode($slug)); - %D1 if true, it's: %d1%83%d0%bd %d0%b8%d0%b2%d0%b5%d1%80%d1%81%d0%b8%d1%82%d0%b5%d1%82%d1%81%d0%ba %d0%b8 why, pls help me ! I'm using: cake 1.2.6, apache 2.2.15 and mysql 5.1 Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
how to include one .ctp file
I want know how to include one .ctp file in another .ctp file Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
javascript validation
hi frns can any one help me how to validate javascript from clint side and how to pass the variables through javascript. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: AppController being cached?
Every piece of code is being executed. But whatever I add to it, don't have effects. I tried die, debug and, as I said, neither invalidating the code nor deleting the file affects the app. Lucca Mordentre Are you _certain_ you are editing the right app files? It's sounds implausible to me that this could happen, opcode cache's don't store changes. J -- jon bennett - www.jben.net - blog.jben.net Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Sending view parameters to javascript function
Hi ! I am using the same code, but i am not getting the out. please help me out On Apr 16, 3:57 pm, Ed Propsner crotchf...@gmail.com wrote: If it's your Javascript that's not working I would use: function validate() { var username=Form.Element.getValue('UserUsername'); window.alert(username); } - Ed On Fri, Apr 16, 2010 at 6:46 AM, Ambika Kulkarni ambikakulkarn...@gmail.com wrote: Hi All, I want to send the post data to a javascript function. I have put the code below . Please help name view.ctp If I am just calling the js function it works. . function validate() { window.alert(It's working); } ?php echo $form-create('User', array('action' ='login')); echo $form-input(username); echo $form- submit('signin.gif',array('width'=100,'height'=22,'onclick'='validate()')); echo $form-end(); ? But when I am trying to do like the following it wont work function validate() { var username=document.User.username.value; window.alert(username); } ?php echo $form-create('User', array('action' ='login')); echo $form-input(username); echo $form-submit('signin.gif',array('width'=100, 'height'=22,'onclick'='validate()')); echo $form-end(); ? Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Sending view parameters to javascript function
hi all var username=Form.Element.getValue('UserUsername'); i have a doubt UserUsername - field name or form name or model name and is there any specilalcharacte between User and Username. i am using this both form name and inputfiled name Form name : echo $form-create('User', array('action' ='login')); input filed : echo $form-input(username); I am using On Fri, Apr 16, 2010 at 4:27 PM, Ed Propsner crotchf...@gmail.com wrote: If it's your Javascript that's not working I would use: function validate( { var username=Form.Element.getValue('UserUsername'); window.alert(username); } - Ed On Fri, Apr 16, 2010 at 6:46 AM, Ambika Kulkarni ambikakulkarn...@gmail.com wrote: Hi All, I want to send the post data to a javascript function. I have put the code below . Please help name view.ctp If I am just calling the js function it works. . function validate(){ window.alert(It's working); } ?php echo $form-create('User', array('action' ='login')); echo $form-input(username); echo $form- submit('signin.gif',array('width'=100,'height'=22,'onclick'='validate()')); echo $form-end(); ? But when I am trying to do like the following it wont work function validate() { var username=document.User.username.value; window.alert(username); } ?php echo $form-create('User', array('action' ='login')); echo $form-input(username); echo $form-submit('signin.gif',array('width'=100, 'height'=22,'onclick'='validate()')); echo $form-end(); ? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: how to include one .ctp file
Save the inner one as an element, then: echo $this-element(**filename**); where **filename** is the name of the element file without the ctp extension. You can pass variables in: echo $this-element( **filename**, array('varibaleName' = $variable) ); Elements are stored in /app/views/elements. You can organise them into subfolders too, so for example echo $this-element('subfolder/subsubfolder/file'); Jeremy Burns jeremybu...@me.com On 16 Apr 2010, at 11:19, MANOJ DHAMAL wrote: I want know how to include one .ctp file in another .ctp file Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: AppController being cached?
Yes. When I delete the app_controller.php nothing happens. But when delete or invalidate the app_model.php file, in the same directory, the app stops to work, as expected. Lucca Mordente On Thu, Apr 15, 2010 at 11:30 PM, Miles J mileswjohn...@gmail.com wrote: Are you uploading it to the right directory? Correct naming, etc. On Apr 15, 5:47 pm, Lucca Mordente luccamorde...@gmail.com wrote: That's the point. No change is being reflected. And the website continues to work even when the app_controller.php file is deleted, as if it was there. Lucca Mordente On Thu, Apr 15, 2010 at 9:43 PM, cricket zijn.digi...@gmail.com wrote: On Apr 15, 7:30 pm, Lucca Mordente luccamorde...@gmail.com wrote: Up!! This is a problem in an operating website in which I have to make some changes. Any ideas about what can be happening? What changes to AppController are you making? Perhaps there's another explanation than cache. Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.com cake-php%2bunsubscr...@googlegroups.comcake-php%252bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group athttp:// groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Sending view parameters to javascript function
Hey All You may making a mistake plz use it before it include ?php e($javascript-link('prototype-1.6.1', false)); ? ?php echo $form-input('username'); ? which out here input name=data[formname][username] type=text onchange=autoDisplay() value= id=FormnameUsername / function validate() { alert(Form.Element.getValue('id')); } Note in place of id should take id of that element. alert(Form.Element.getValue('FormnameUsername')); Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: AppController being cached?
Sounds drastic, but is it worth rebooting the box? Not sure if that would help of course. Jeremy Burns jeremybu...@me.com On 16 Apr 2010, at 14:27, Lucca Mordente wrote: Yes. When I delete the app_controller.php nothing happens. But when delete or invalidate the app_model.php file, in the same directory, the app stops to work, as expected. Lucca Mordente On Thu, Apr 15, 2010 at 11:30 PM, Miles J mileswjohn...@gmail.com wrote: Are you uploading it to the right directory? Correct naming, etc. On Apr 15, 5:47 pm, Lucca Mordente luccamorde...@gmail.com wrote: That's the point. No change is being reflected. And the website continues to work even when the app_controller.php file is deleted, as if it was there. Lucca Mordente On Thu, Apr 15, 2010 at 9:43 PM, cricket zijn.digi...@gmail.com wrote: On Apr 15, 7:30 pm, Lucca Mordente luccamorde...@gmail.com wrote: Up!! This is a problem in an operating website in which I have to make some changes. Any ideas about what can be happening? What changes to AppController are you making? Perhaps there's another explanation than cache. Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: AppController being cached?
On Apr 16, 3:27 pm, Lucca Mordente luccamorde...@gmail.com wrote: Yes. When I delete the app_controller.php nothing happens. But when delete or invalidate the app_model.php file, in the same directory, the app stops to work, as expected. why don't you put debug(get_included_files()); somewhere and look which app_controller you're including and then determine why. AD Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: AppController being cached?
Holy God... that's the answare I was needing... thanks AD! can't believe and can't convey why there was an app_controller.php inside the app/controllers folder. Probably I made any mess with my FTP client (File Zilla). Do you guys have any FTP client you like, or another deploy tool? Thank you again! Lucca Mordente On Fri, Apr 16, 2010 at 10:40 AM, AD7six andydawso...@gmail.com wrote: On Apr 16, 3:27 pm, Lucca Mordente luccamorde...@gmail.com wrote: Yes. When I delete the app_controller.php nothing happens. But when delete or invalidate the app_model.php file, in the same directory, the app stops to work, as expected. why don't you put debug(get_included_files()); somewhere and look which app_controller you're including and then determine why. AD Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: view as downloadable text/plain
I just wrote a quick PlaintextHelper (3 minutes!) based on the CsvHelper I'm already using. Check it out here: http://pastebin.com/u46cWX7T Well it does not work, header is still html. I also do not understand why it should work. The only thing you are doing is taking elements/users/txt_dump.ctp as view and then using header('Content-type: text/plain'); in a function called from this view. In your last mail you explained me, that it is not possible to change the header from a view because of output buffering. So why should it work here? Melanie Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: AppController being cached?
Holy God... that's the answer I was needing... thanks AD! can't believe and can't convey why there was an app_controller.php inside the app/controllers folder. Probably I made any mess with my FTP client (File Zilla). Do you guys have any FTP client you like, or another deploy tool? Thank you again! Lucca Mordente On 16 abr, 10:40, AD7six andydawso...@gmail.com wrote: On Apr 16, 3:27 pm, Lucca Mordente luccamorde...@gmail.com wrote: Yes. When I delete the app_controller.php nothing happens. But when delete or invalidate the app_model.php file, in the same directory, the app stops to work, as expected. why don't you put debug(get_included_files()); somewhere and look which app_controller you're including and then determine why. AD Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: AppController being cached?
Holy God... that's the answer I was needing... thanks AD! can't believe and can't convey why there was an app_controller.php inside the app/controllers folder. Probably I made any mess with my FTP client (File Zilla). Do you guys have any FTP client you like, or another deploy tool? Thank you again! Lucca Mordente On 16 abr, 10:40, AD7six andydawso...@gmail.com wrote: On Apr 16, 3:27 pm, Lucca Mordente luccamorde...@gmail.com wrote: Yes. When I delete the app_controller.php nothing happens. But when delete or invalidate the app_model.php file, in the same directory, the app stops to work, as expected. why don't you put debug(get_included_files()); somewhere and look which app_controller you're including and then determine why. AD Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: view as downloadable text/plain
I now simply wrote header(Content-Type: text/plain); header('Content-Disposition: attachment; filename=text.txt'); into my controller - that seems rather dirty, but it works. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Tip: MongoDB-Datasource undocumented feature
I did not know the datasource could do this and almost didn't try it as a result. Don't make the same mistake. Yasushi Ichikaway has developed a very nice datasource for MongoDB. http://github.com/ichikaway/mongoDB-Datasource/ Mars Story wrote a very nice intro post about it. http://mark-story.com/posts/view/using-mongodb-with-cakephp After looking at the github page and reading Mark's post I was convinced that only ordinary scalar values were supported by the MongoDB datasource. The source lists only strings, integers and stuff as datatypes... not objects, arrays or hierarchies in any form. The good news is that deep nested arrays of data are supported. THis is a big deal and I don't want anyone else to give this plugin a pass just because they draw the same conclusions I did. From my experience, any field defined in the schema can be an array and contain any hierarchical data. I have given these fields the datatype array without an error just to indicate to myself that they are hierarchies. I have not been able to just add a new root level field but anything inside a defined field can have any data structure added to it. Example: var $mongoSchema = array( 'some_string' = array('type'='string'), 'data'=array('type'='array'), // just a reminder for me 'created'=array('type'='datetime'), 'modified'=array('type'='datetime'), ); For this model I can save anything inside data. Like: $this-data['Modelname']['data']['hello']['world'] = 'cool'; Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
HABTM Relations in Plugin
Imagine a plugin called Cms, with several models, two of them called Menu and Link. The Links have a HABTM relationship to the Menus. In order to set that up in the model I used the following relationship in the Link model: {{{ var $hasAndBelongsToMany = array( 'Cms.Menu' = array( 'className' = 'Cms.Menu', 'joinTable' = 'cms_menus_links', 'foreignKey' = 'link_id', 'associationForeignKey' = 'menu_id', 'unique' = true, 'conditions' = '', 'fields' = '', 'order' = '', 'limit' = '', 'offset' = '', 'finderQuery'= '', 'deleteQuery'= '', 'insertQuery'= '' ) ); }}} As you can see, I use the prefix Cms. for the className as well as for the key in the array. This is needed for Cake understands the relation between my models and my plugin Cms from it. Now look at the query Cake creates after I call a find in my LinkController in the Cms plugin: {{{ SELECT `cms`.`Menu`.`id`, ... `cmsMenusLink`.`menu_id`, `cmsMenusLink`.`link_id` FROM `cms_menus` AS **`cms`.`Menu`** JOIN `cms_menus_links` AS `cmsMenusLink` ON (`cmsMenusLink`.`link_id` = 4 AND `cmsMenusLink`.`menu_id` = `cms`.`Menu`.`id`) }}} The query fails (syntax error) because it wants to join on an alias called `Cms`.`Menu`. How can i fix this? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
the plugins dont work at all
hi why i cant accses any plugin i create ? i make the manual tutorial to create the pizzOrder plugin but i cant access to it /pluginname/controllername/action so i bake another plugin but i cant access it to app/plugin/poll/ i try http://localhost/appname/poll/ it dont work Error: PollController could not be found. Error: Create the class PollController below in file: appname \controllers\poll_controller.php so i download a ready to user plugin and i cant access it to ? the plugin is AJAX star rating plugin for CakePHP 1.2 i try http://localhost/appname/rating/ so what i'm doing wrong ? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Bookmarkable AJAX URLs
Hi! I use ajax link (by ajax helper) in my current app almost everywhere. I now, when user navigate throw the site, URLs in the browser address line didn't changed. That's why user can't create bookmarks. Does anyone knew, how to push browser change address line, or some other workaround. p.s. I knew one way - add # to each url. Browser will automatically add this parameter to address line. But seems that this is too ugly workaround. (And I don't know how to implement it by using Cake) Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Bookmarkable AJAX URLs
Afaik using # is the way to go. Changing any other aspect of the url besides what comes after the # will result in a load of the changed url by the browser. You don't need Cake to change the url's, just some javascript code that you execute every time the user navigates using your ajax links. On Fri, Apr 16, 2010 at 5:41 PM, Dmitry Shevchenko dmitr...@gmail.comwrote: Hi! I use ajax link (by ajax helper) in my current app almost everywhere. I now, when user navigate throw the site, URLs in the browser address line didn't changed. That's why user can't create bookmarks. Does anyone knew, how to push browser change address line, or some other workaround. p.s. I knew one way - add # to each url. Browser will automatically add this parameter to address line. But seems that this is too ugly workaround. (And I don't know how to implement it by using Cake) Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Advice for personalized email (i.e. newsletter, mass email)
tcornett, Swift Mailer handles persistent connections. It also handles throttling and secure connections to smtp. I've yet to find a component/plugin/behavior that wraps swift mailer or any other mailer in a way that takes advantage of persistent connections and throttling features. However the Component is fairly short and might be a good starting point to just re-write in a function that can handle the looping while in one connection. I've written a task which i call from a background queue that uses the swiftmailer component. And swiftmailer is very complete and simple to use. From my app I add a bunch of task to the queue. Then in the background those task are pulled and processed. Each of my email templates use a variable replacement where I can do a preg_replace looking for patterns like {placeholder} and inject to that placeholder new content. Currently i'm making a new connection for each email using the swiftmailer component. This has been sufficient for my needs up to this point, but I may have to visit this issue sooner than later. The component needs to be updated to make use of the persistent connection and throttling. But this may be a good start for you. The component does have a couple CallBacks, but I think it would need to be augmented with a singleton reference to the active SwiftMailer Object then you could easily check if a connection was already open and continue to use it. Queue background processing: http://github.com/MSeven/cakephp_queue SwiftMailer: http://swiftmailer.org/ SwiftMailer Component: http://bakery.cakephp.org/articles/view/updated-swiftmailer-4-xx-component-with-attachments-and-plugins On Apr 15, 4:36 pm, tcornett tcorn...@gmail.com wrote: I am looking to setup an aspect of my cakephp application to handle the emailing of a large number of individuals with a personalized email message. [THIS IS NOT FOR SPAM] I have been looking around and I cant really seem to find anything that handles this situation well. A couple of the major roadblocks that I have run into are : 1) Persistent connection with the SMTP server. Instead of connecting for one message, I need to be able to connect, send X emails, and then disconnect. There does not seem to be anything out there for this type of behavior 2) The need for personalization in each email. It can not be 1 email with 50 recipients. It would end up being 50 emails each with different information in the body of the email. 3) Request timeout - If I try to send them all at once, the request will time out. I would rather have a setup where an automated process picks up the email and sends them. I have looked into CRON jobs based solutions, found basic queue and deferring processing techniques but nothing really handles this situation, IMHO is a pretty basic problem for any application with users. I know I am basically building a mailing list manager but it is just going to be one aspect of the app. Does anyone have any directions to point me in or ideas for solutions? Thanks in advance for any help. Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Multi-level Models in CakePHP
Walther, Thanks for the comment... but that line of code also only produces a result of ATable and BTable. Still looking for a way... Sorry about the naming... I only figured that giving simplified model names would have made it easier to see that I'm just trying to make a multi-level model relationship. The real model names get longer as the level gets deeper. For example: ScheduleTemplate hasMany ScheduleTemplateBlocks ScheduleTemplateBlocks hasMany ScheduleTemplateBlockTableColumns ScheduleTemplateBlockTableColumns belongsTo ScheduleTemplateBlocks ATable hasMany BTable BTable hasMany CTable CTable belongsTo BTable I chose that route for readability, but I can keep it in mind for next time. Thanks On Apr 15, 10:20 pm, Walther waltherl...@gmail.com wrote: Alan gave the wrong syntax for containable. It is: $this-ATable-find('all', array('contain'=array('BTable' = array('CTable'; And Andy, in the future please use real model names, makes it much easier to see what is happening and sometimes people make mistakes when converting to the alphabet models. On Apr 16, 5:12 am, andy sum...@gmail.com wrote: Hi Alan, Thanks for the idea. I tried using 'contain' just now and I still am just seeing ATable and BTable results in the returned array. I'll keep playing around with containable anyhow... Andy On Apr 15, 7:16 pm, Alan Asher a...@asteriskpound.com wrote: I think you need a contain to include the third table. $this-ATable-find('all', array('contain'=array('BTable','BTable.CTable'))); That's just off the hip Alan -Original Message- From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf Of andy Sent: Thursday, April 15, 2010 6:25 PM To: CakePHP Subject: Re: Multi-level Models in CakePHP Or maybe I'm trying to go for returned data in this type of format... though I don't know if it's possible: Array ( [0] = Array ( [ATable] = Array ( [id] = 1 [name] = A [weight] = 1 ) [BTable] = Array ( [id] = 1 [name] = B [a_table_id] = 1 [weight] = 1 Array ( [0] = Array ( [CTable] = Array ( [id] = 1 [name] = C [b_table_id] = 1 [weight] = 1 ) ) ) ) ) ) On Apr 15, 5:38 pm, andy sum...@gmail.com wrote: Has anyone successfully been able to do something like this? (I'm using CakePHP 1.3 RC4) I have three models: class ATable extends AppModel { var $name = 'ATable'; var $hasOne = array('BTable' = array( 'foreignKey' = false, 'type' = 'INNER', 'conditions' = array( 'BTable.a_table_id = ATable.id') ) ); } class BTable extends AppModel { var $name = 'BTable'; var $hasOne = array('CTable' = array( 'foreignKey' = false, 'type' = 'INNER', 'conditions' = array( 'CTable.b_table_id = BTable.id') ) ); } class CTable extends AppModel { var $name = 'CTable'; } And I have the following MySQL tables: CREATE TABLE a_tables ( id INT(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), schedule_template_id INT(11), weight INT(11) ); INSERT INTO a_tables (name, weight) VALUES ('A', 1); CREATE TABLE b_tables ( id INT(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), a_table_id INT(11), weight INT(11) ); INSERT INTO b_tables (name, a_table_id, weight) VALUES ('B', 1, 1); CREATE TABLE c_tables ( id INT(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), b_table_id INT(11), weight INT(11) ); INSERT INTO c_tables (name, b_table_id, weight) VALUES ('C', 1, 1); In my a_tables_controller.php file it looks like the following: class ATablesController extends AppController { var $name = 'ATables'; function index() { $this-set('a_var', $this-ATable-find('all')); } } And I am expecting CakePHP to set
Re: Email Component: I see html email as source code in Squirrel mail web client
Let your users define whether they wish to receive emails from you in html or plain text. Then it is up to them to change it to the right choice, should their email solution not be able to show the chosen format. If you don't want to do that, then maybe just send a plain text email, that also contains the address of the html version, so that they can see the html version in the browser instead. Should any other have another idea, please enlighten us :) Enjoy, John On Apr 16, 9:26 am, Prof. No Time libertylivingst...@gmail.com wrote: When I send Email via the Email Component as Both i.e. html and text. It appears fine in my outlook and also yahoo and I think Gmail too but when I check it in Squirrel Mail webmail interface, it shows the text portion first, then the html source code underneath. This is pretty embarrassing as most of my clients will be checking via webmail. What can I do to prevent this, please. Thank You. Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Model and Controller aliases
Some of my model and controller classes have very long, and therefore descriptive, names. The problem is that it's a real pain to use these when coding, but I want the names to be as descriptive as possible when reviewing the files. It would be really nice if we could define an alias that could be used instead of the full model/controller name when calling actions. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: HABTM Relations in Plugin
As far as I understand from the CakePHP book on plugins, you are using the alternative syntax for naming the association, thus you should not use Cms.Menu but Menu as your association key. See http://book.cakephp.org/view/117/Plugin-Models Are your model for the menu named Menu or CmsMenu? The CakePHP book do suggest that you add your plugin name to the model name, thus Menu becomes CmsMenu, and thus you should be able to avoid conflict with other models in the application (in case on is named Menu). Hope this helps you on the way, enjoy, John On Apr 16, 4:48 pm, birthdaycake wrde...@gmail.com wrote: Imagine a plugin called Cms, with several models, two of them called Menu and Link. The Links have a HABTM relationship to the Menus. In order to set that up in the model I used the following relationship in the Link model: {{{ var $hasAndBelongsToMany = array( 'Cms.Menu' = array( 'className' = 'Cms.Menu', 'joinTable' = 'cms_menus_links', 'foreignKey' = 'link_id', 'associationForeignKey' = 'menu_id', 'unique' = true, 'conditions' = '', 'fields' = '', 'order' = '', 'limit' = '', 'offset' = '', 'finderQuery' = '', 'deleteQuery' = '', 'insertQuery' = '' ) ); }}} As you can see, I use the prefix Cms. for the className as well as for the key in the array. This is needed for Cake understands the relation between my models and my plugin Cms from it. Now look at the query Cake creates after I call a find in my LinkController in the Cms plugin: {{{ SELECT `cms`.`Menu`.`id`, ... `cmsMenusLink`.`menu_id`, `cmsMenusLink`.`link_id` FROM `cms_menus` AS **`cms`.`Menu`** JOIN `cms_menus_links` AS `cmsMenusLink` ON (`cmsMenusLink`.`link_id` = 4 AND `cmsMenusLink`.`menu_id` = `cms`.`Menu`.`id`) }}} The query fails (syntax error) because it wants to join on an alias called `Cms`.`Menu`. How can i fix this? Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Get params unicode error
Hi, You should post this question into a general PHP forum or mailing list. PHP's urlencode and urldecode have no problem with cp1251 encoding and decoding. Are you sure that your page encoding is correct? Regards, Dinh On Fri, Apr 16, 2010 at 11:21 AM, Cuong Vo Viet vovietcu...@gmail.comwrote: My function function view($slug=null){ echo $slug; } enter url: - products/view/университетски or: - products/view/%d1%83%d0%bd %d0%b8%d0%b2%d0%b5%d1%80%d1%81%d0%b8%d1%82%d0%b5%d1%82%d1%81%d0%ba %d0%b8 pr(urlencode($slug)); - %D1 if true, it's: %d1%83%d0%bd %d0%b8%d0%b2%d0%b5%d1%80%d1%81%d0%b8%d1%82%d0%b5%d1%82%d1%81%d0%ba %d0%b8 why, pls help me ! I'm using: cake 1.2.6, apache 2.2.15 and mysql 5.1 -- Spica Framework: http://code.google.com/p/spica http://www.twitter.com/pcdinh http://groups.google.com/group/phpvietnam Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: getting a 3rd-hand database value without recursive = 2
Thank you. I have applied the Containable behavior to the specific query. Jury is still out on how I'll choose to implement it throughout the system. On Apr 15, 12:50 am, Jeremy Burns jeremybu...@me.com wrote: Two options... Use $this-Service-find(); instead Or... I would use the Containable behaviour - this seems like such a recurring piece of advice from me - but it really does solve a heap of issues! If you don't use contain, you are more or less letting Cake decide what data to bring back - and I have worked on a few second hand systems where a single, simple, find statement has brought back almost the entire database - seriously. Imagine what that does to performance... Create app_model.php and store it in the same folder as app_controller.php. class AppModel extends Model { var $actsAs = array('Containable'); var $recursive = -1; } Now, you have switched off recursion across the system, so by default a find will only bring back the 'current' model's table (in other words, no associated data). This might mean you have to revisit some existing queries. But the benefit is that you can now do really finds. In your case: $this-Service-find( 'all', array( 'conditions' = array('Service.id' = $id), 'fields' = array(..field list...), 'Contain' = array( 'Credential' = 'fields' = array(...field list...), array( 'CredentialType' = array( 'fields' = array(...field list...) ) ) ) ) ); You could also just put the containable behaviour inside your Service model, but I don't see the point of doing something so beneficial on just a portion of your app. Jeremy Burns jeremybu...@me.com On 14 Apr 2010, at 22:01, Joshua Taylor wrote: Situation: Viewing a service. A service has credentials. Credentials have a credential type. I'm using $service = $this-Service-findById($id); to set all the data for my view. I have all the database associations set up correctly (I think): Service hasMany Credential. Credential belongsTo Service, CredentialType. CredentialType hasMany Credential. How can I get it to retrieve CredentialType.title, so I can display the title instead of the Credential.credential_type_id value, which is worthless to a person viewing the service? I really don't want to use recursive = 2 (although it works), because it creates enormous database overhead! (55 queries vs. 25) Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en To unsubscribe, reply using remove me as the subject. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: the plugins dont work at all
Hi, Plugins do work. I have whole apps build with a limited core and numerous plugins (22 of them in one case). I can think of a few details to double-check. I don't think you should have plugins named in camelCase. Try naming the folder and the urls you try pizza_order instead. (The plugin in the manual is simply named pizza btw) app/plugin/poll/ the plugins folder should be named plugins (with an s). You write it in singular form without the s in one place. Plugins must have the equivalent of pizza_app_controller.php and possible pizza_app_model.php too. Without them the plugin will not be found. At least that was the case when I started using plugins, it may have changed but I still have them in each plugin. The final detail I can think of is some rewrite detail messing with you. Unlikely but since I never run apps as anything but their own vhost I can't be 100% how plugins react to being in a subfolder. (as in localhost/apname/) Those are all long-shots but they are all I can think of that might be the cause. Good luck. /Martin On Apr 16, 5:28 pm, islam4hak islamco...@gmail.com wrote: hi why i cant accses any plugin i create ? i make the manual tutorial to create the pizzOrder plugin but i cant access to it /pluginname/controllername/action so i bake another plugin but i cant access it to app/plugin/poll/ i tryhttp://localhost/appname/poll/ it dont work Error: PollController could not be found. Error: Create the class PollController below in file: appname \controllers\poll_controller.php so i download a ready to user plugin and i cant access it to ? the plugin is AJAX star rating plugin for CakePHP 1.2 i tryhttp://localhost/appname/rating/ so what i'm doing wrong ? Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
avoid delte of a model if related models exist
hi there, cake stats to be a nice toy tool so far :) ... I am on the next step of developing my littl app and would like to get some hints how to do best this: I have 3 models linked with each other mod1, mod2, mod3 mod 1 hasOne mod2 mod2 hasMany mod3 So deleting some mod1 data with having a related in mod2 would be no good idea. How can I avoid deleting a model entry if a related entry in other models exist? Thanks in advance Michael cake 1.3 RCx Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Adding multiple form fields with autocomplete
Hi, I've noticed that CakePHP has an autoComplete helper, but I'm having trouble figuring out how to make it work for my application: http://book.cakephp.org/view/632/autoComplete I have 3 controllers: PracticeItems PracticeInstances PracticeSessions A PracticeSession will have 1 or more PracticeInstances A PracticeInstance has 1 PracticeItem I'm working on the add method for PracticeSessions. This form should start with 4 fields: PracticeItem.0.name (this one is autocomplete) PracticeInstance.0.timeminutes PracticeInstance.0.tempostart PracticeInstance.0.tempofinish It shouldn't be hard to add a button that will generate another 4 fields with the value 0 incremented accordingly. My problem is that autoComplete() accepts its argument as ModelName.FieldName. I can't use the notation with a number in the middle. This means when I get back $this-data I have something like: Array ( [PracticeItem] = Array ( [name] = Another Test Item ) [PracticeInstance] = Array ( [0] = Array ( [timeminutes] = 20 [tempostart] = 100 [tempofinish] = 120 ) ) ) But what I want is Array ( [PracticeItem] = Array ( [0] = Array ( [name] = Another Test Item ) ) [PracticeInstance] = Array ( [0] = Array ( [timeminutes] = 20 [tempostart] = 100 [tempofinish] = 120 ) ) ) This would be trivial for a single entry, but as I'll be adding more form fields on the fly, I'm not sure how it will work if I can't say $ajax-autoComplete('PracticeItem.n.name', '/practice_items/ autoComplete') I'm thinking I could add an extra parameter to the autoComplete function, but since it's built in, I'm not sure how to go about this. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: the plugins dont work at all
You are doing it wrong, the URLs would be like so: domain.com/controller/action/ domain.com/plugin/controller/action/ You cant go to domain.com/plugin/ and have it work without setting up routes. On Apr 16, 11:18 am, Martin Westin martin.westin...@gmail.com wrote: Hi, Plugins do work. I have whole apps build with a limited core and numerous plugins (22 of them in one case). I can think of a few details to double-check. I don't think you should have plugins named in camelCase. Try naming the folder and the urls you try pizza_order instead. (The plugin in the manual is simply named pizza btw) app/plugin/poll/ the plugins folder should be named plugins (with an s). You write it in singular form without the s in one place. Plugins must have the equivalent of pizza_app_controller.php and possible pizza_app_model.php too. Without them the plugin will not be found. At least that was the case when I started using plugins, it may have changed but I still have them in each plugin. The final detail I can think of is some rewrite detail messing with you. Unlikely but since I never run apps as anything but their own vhost I can't be 100% how plugins react to being in a subfolder. (as in localhost/apname/) Those are all long-shots but they are all I can think of that might be the cause. Good luck. /Martin On Apr 16, 5:28 pm, islam4hak islamco...@gmail.com wrote: hi why i cant accses any plugin i create ? i make the manual tutorial to create the pizzOrder plugin but i cant access to it /pluginname/controllername/action so i bake another plugin but i cant access it to app/plugin/poll/ i tryhttp://localhost/appname/poll/ it dont work Error: PollController could not be found. Error: Create the class PollController below in file: appname \controllers\poll_controller.php so i download a ready to user plugin and i cant access it to ? the plugin is AJAX star rating plugin for CakePHP 1.2 i tryhttp://localhost/appname/rating/ so what i'm doing wrong ? Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: the plugins dont work at all
On Apr 16, 9:39 pm, Miles J mileswjohn...@gmail.com wrote: You are doing it wrong, the URLs would be like so: domain.com/controller/action/ domain.com/plugin/controller/action/ You cant go to domain.com/plugin/ and have it work without setting up routes. Since when. I'd suggest checking the book and/or test cases before telling people they're doing it wrong. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Model and Controller aliases
On Apr 16, 7:59 pm, Scott scott.bent...@gmail.com wrote: Some of my model and controller classes have very long, and therefore descriptive, names. The problem is that it's a real pain to use these when coding, but I want the names to be as descriptive as possible when reviewing the files. It would be really nice if we could define an alias that could be used instead of the full model/controller name when calling actions. Is the missing question what do routes and model aliases do? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Tip: MongoDB-Datasource undocumented feature
Amazing !!! Cake now supports noSQL !!! Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Blank page when CakePHP is uploaded to the server
I'm back to this again... have changed web hosts, and got everything uploaded. I'm no longer getting the blank page, but I'm getting errors. It looks like cake isn't picking up the css or javascript - if you go to www.softwaresolutionsni.co.uk you'll see what I mean. There are random bits of code and no styling. At one point there was an error which said something like 'call to member function on non object', and which pointed to a link to a javascript file which says echo $javascript-link('headers_ie6'); However, that error has now disappeared. I've cleared the tmp files, made sure tmp is writeable, and enabled debug at level 2. The debug and error logs have a fair bit in them: debug.log: 2010-04-16 19:51:34 Debug: Notice (8): Undefined variable: javascript in [APP\views\elements\footer.ctp, line 7] error.log (I've just given the first couple of lines below, because there are quite a few and I assume they are stemming from these): 2010-04-16 19:51:34 Warning: Warning (2): mysql_connect() [a href='http://php.net/function.mysql-connect'function.mysql-connect/ a]: Access denied for user '*** '@'*' (using password: YES) in [CORE\cake\libs\model\datasources\dbo\dbo_mysql.php, line 374] 2010-04-16 19:51:34 Warning: Warning (2): mysql_select_db(): supplied argument is not a valid MySQL-Link resource in [CORE\cake\libs\model \datasources\dbo\dbo_mysql.php, line 379] Obviously the first line in error log has the user name and host, where I've put the *'s, but the host seems to be wrong, although I've checked in database.php and it is correct there. I'm not sure what to do - it looks like it's getting the host wrong - any ideas why it would have a different host in error.log than database.php? Would that be causing the rest of the errors? I'd be very grateful if someone could point me in the direction of the files to check. Thanks, Sharon Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: HABTM Relations in Plugin
Thank you for your reply, John! I have tried what you and the book suggest: * I renamed all the models, controllers and folder names with the Cms* prefix * I changed the relations accordingly This is what happens: When I change the HABTM relation to: array('CmsMenu' = array('className' = 'CmsMenu' ... Cake refuses to load the relations, so I went back to: array('Cms.CmsMenu' = array('Cms.className' = 'CmsMenu' ... That works for Cake, but the query has syntax errors all over again. Does this look like a bug? It looks like something like this: it uses the period fine as a reference to a plugin model, but it does not integrate well with the sanitized query (wrapping the strings around the periods with a `. Any ideas? Maybe if I create a model for the join table (cms_menus_links)? On Apr 16, 8:06 pm, John Andersen j.andersen...@gmail.com wrote: As far as I understand from the CakePHP book on plugins, you are using the alternative syntax for naming the association, thus you should not use Cms.Menu but Menu as your association key. Seehttp://book.cakephp.org/view/117/Plugin-Models Are your model for the menu named Menu or CmsMenu? The CakePHP book do suggest that you add your plugin name to the model name, thus Menu becomes CmsMenu, and thus you should be able to avoid conflict with other models in the application (in case on is named Menu). Hope this helps you on the way, enjoy, John On Apr 16, 4:48 pm, birthdaycake wrde...@gmail.com wrote: Imagine a plugin called Cms, with several models, two of them called Menu and Link. The Links have a HABTM relationship to the Menus. In order to set that up in the model I used the following relationship in the Link model: {{{ var $hasAndBelongsToMany = array( 'Cms.Menu' = array( 'className' = 'Cms.Menu', 'joinTable' = 'cms_menus_links', 'foreignKey' = 'link_id', 'associationForeignKey' = 'menu_id', 'unique' = true, 'conditions' = '', 'fields' = '', 'order' = '', 'limit' = '', 'offset' = '', 'finderQuery' = '', 'deleteQuery' = '', 'insertQuery' = '' ) ); }}} As you can see, I use the prefix Cms. for the className as well as for the key in the array. This is needed for Cake understands the relation between my models and my plugin Cms from it. Now look at the query Cake creates after I call a find in my LinkController in the Cms plugin: {{{ SELECT `cms`.`Menu`.`id`, ... `cmsMenusLink`.`menu_id`, `cmsMenusLink`.`link_id` FROM `cms_menus` AS **`cms`.`Menu`** JOIN `cms_menus_links` AS `cmsMenusLink` ON (`cmsMenusLink`.`link_id` = 4 AND `cmsMenusLink`.`menu_id` = `cms`.`Menu`.`id`) }}} The query fails (syntax error) because it wants to join on an alias called `Cms`.`Menu`. How can i fix this? Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Blank page when CakePHP is uploaded to the server
try to change ? to ?php Andras On Apr 16, 2010, at 4:10 PM, WhyNotSmile wrote: I'm back to this again... have changed web hosts, and got everything uploaded. I'm no longer getting the blank page, but I'm getting errors. It looks like cake isn't picking up the css or javascript - if you go to www.softwaresolutionsni.co.uk you'll see what I mean. There are random bits of code and no styling. At one point there was an error which said something like 'call to member function on non object', and which pointed to a link to a javascript file which says echo $javascript-link('headers_ie6'); However, that error has now disappeared. I've cleared the tmp files, made sure tmp is writeable, and enabled debug at level 2. The debug and error logs have a fair bit in them: debug.log: 2010-04-16 19:51:34 Debug: Notice (8): Undefined variable: javascript in [APP\views\elements\footer.ctp, line 7] error.log (I've just given the first couple of lines below, because there are quite a few and I assume they are stemming from these): 2010-04-16 19:51:34 Warning: Warning (2): mysql_connect() [a href='http://php.net/function.mysql-connect'function.mysql-connect/ a]: Access denied for user '*** '@'*' (using password: YES) in [CORE\cake\libs\model\datasources\dbo\dbo_mysql.php, line 374] 2010-04-16 19:51:34 Warning: Warning (2): mysql_select_db(): supplied argument is not a valid MySQL-Link resource in [CORE\cake\libs\model \datasources\dbo\dbo_mysql.php, line 379] Obviously the first line in error log has the user name and host, where I've put the *'s, but the host seems to be wrong, although I've checked in database.php and it is correct there. I'm not sure what to do - it looks like it's getting the host wrong - any ideas why it would have a different host in error.log than database.php? Would that be causing the rest of the errors? I'd be very grateful if someone could point me in the direction of the files to check. Thanks, Sharon Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: HABTM Relations in Plugin
YES!! Fixed it! It seems that renaming everything and going over all the code again worked. I set up the join table and used a 'with' = .. in the model's habtm relations. Thank you for reviewing my question, and thank you all for CAKE! :) On Apr 16, 10:27 pm, birthdaycake wrde...@gmail.com wrote: Thank you for your reply, John! I have tried what you and the book suggest: * I renamed all the models, controllers and folder names with the Cms* prefix * I changed the relations accordingly This is what happens: When I change the HABTM relation to: array('CmsMenu' = array('className' = 'CmsMenu' ... Cake refuses to load the relations, so I went back to: array('Cms.CmsMenu' = array('Cms.className' = 'CmsMenu' ... That works for Cake, but the query has syntax errors all over again. Does this look like a bug? It looks like something like this: it uses the period fine as a reference to a plugin model, but it does not integrate well with the sanitized query (wrapping the strings around the periods with a `. Any ideas? Maybe if I create a model for the join table (cms_menus_links)? On Apr 16, 8:06 pm, John Andersen j.andersen...@gmail.com wrote: As far as I understand from the CakePHP book on plugins, you are using the alternative syntax for naming the association, thus you should not use Cms.Menu but Menu as your association key. Seehttp://book.cakephp.org/view/117/Plugin-Models Are your model for the menu named Menu or CmsMenu? The CakePHP book do suggest that you add your plugin name to the model name, thus Menu becomes CmsMenu, and thus you should be able to avoid conflict with other models in the application (in case on is named Menu). Hope this helps you on the way, enjoy, John On Apr 16, 4:48 pm, birthdaycake wrde...@gmail.com wrote: Imagine a plugin called Cms, with several models, two of them called Menu and Link. The Links have a HABTM relationship to the Menus. In order to set that up in the model I used the following relationship in the Link model: {{{ var $hasAndBelongsToMany = array( 'Cms.Menu' = array( 'className' = 'Cms.Menu', 'joinTable' = 'cms_menus_links', 'foreignKey' = 'link_id', 'associationForeignKey' = 'menu_id', 'unique' = true, 'conditions' = '', 'fields' = '', 'order' = '', 'limit' = '', 'offset' = '', 'finderQuery' = '', 'deleteQuery' = '', 'insertQuery' = '' ) ); }}} As you can see, I use the prefix Cms. for the className as well as for the key in the array. This is needed for Cake understands the relation between my models and my plugin Cms from it. Now look at the query Cake creates after I call a find in my LinkController in the Cms plugin: {{{ SELECT `cms`.`Menu`.`id`, ... `cmsMenusLink`.`menu_id`, `cmsMenusLink`.`link_id` FROM `cms_menus` AS **`cms`.`Menu`** JOIN `cms_menus_links` AS `cmsMenusLink` ON (`cmsMenusLink`.`link_id` = 4 AND `cmsMenusLink`.`menu_id` = `cms`.`Menu`.`id`) }}} The query fails (syntax error) because it wants to join on an alias called `Cms`.`Menu`. How can i fix this? Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site
Re: Sending view parameters to javascript function
Sorry about that, I should have specified I was using Prototype ... force of habit. $(UserUsername).getValue();and$F(UserUsername); will also both work with Prototype. - Ed On Fri, Apr 16, 2010 at 9:32 AM, Hani Sana sana8...@gmail.com wrote: Hey All You may making a mistake plz use it before it include ?php e($javascript-link('prototype-1.6.1', false)); ? ?php echo $form-input('username'); ? which out here input name=data[formname][username] type=text onchange=autoDisplay() value= id=FormnameUsername / function validate() { alert(Form.Element.getValue('id')); } Note in place of id should take id of that element. alert(Form.Element.getValue('FormnameUsername')); Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Multi-level Models in CakePHP
Using recursive seems to be a way to go about it: $this-set('a', $this-ATable-find('all', array('recursive' = '2'))); I found this via the following post: http://stackoverflow.com/questions/137314/three-table-related-model-in-cakephp Hope that helps someone. Andy Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Model and Controller aliases
I don't see anything about aliases in the documentation. Routes is not the same as what I'm looking for. A route would make it easy to redirect the user, but I'm talking about the controller and model names used within the code itself. For example, I would like to have the model Warehousetorontomapleavenue or something as descriptive, but inside the controller I don't want to have to use $this- Warehousetorontomapleavenue-read(). I would like a way to use a shorter alias in the code, but keep the long names too. On Apr 16, 3:51 pm, AD7six andydawso...@gmail.com wrote: On Apr 16, 7:59 pm, Scott scott.bent...@gmail.com wrote: Some of my model and controller classes have very long, and therefore descriptive, names. The problem is that it's a real pain to use these when coding, but I want the names to be as descriptive as possible when reviewing the files. It would be really nice if we could define an alias that could be used instead of the full model/controller name when calling actions. Is the missing question what do routes and model aliases do? Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Model and Controller aliases
On Apr 17, 12:05 am, Scott scott.bent...@gmail.com wrote: I don't see anything about aliases in the documentation. Routes is not the same as what I'm looking for. A route would make it easy to redirect the user, but I'm talking about the controller and model names used within the code itself. For example, I would like to have the model Warehousetorontomapleavenue or something as descriptive, but inside the controller I don't want to have to use $this-Warehousetorontomapleavenue-read(). I would like a way to use a shorter alias in the code, but keep the long names too. Do you have a model class named Scott, and are you alergic to hints ;)? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: the plugins dont work at all
If you read the book, it is indeed root_url/plugin_name/plugin_action, so check your sources before you're telling people that they are telling the wrong thing. :) http://book.cakephp.org/view/1113/Plugin-Controllers On Apr 16, 9:47 pm, AD7six andydawso...@gmail.com wrote: On Apr 16, 9:39 pm, Miles J mileswjohn...@gmail.com wrote: You are doing it wrong, the URLs would be like so: domain.com/controller/action/ domain.com/plugin/controller/action/ You cant go to domain.com/plugin/ and have it work without setting up routes. Since when. I'd suggest checking the book and/or test cases before telling people they're doing it wrong. Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Adding multiple form fields with autocomplete
So I've looked further into this, and I tried the obvious solution It seems that the items in $this-data are assigned a number from the name field of the input element. name=data[PracticeInstance][0][tempostart] means the form will feed the data back as $this- data['PracticeInstance']['0']['tempostart'] So when I created my ajax autoComplete field I tried: $ajax-autoComplete('PracticeItem.name', '/practice_items/ autoCompleteName', array('name' = 'data[PracticeItem][0][name]')); For some reason the second autocomplete field won't autocomplete. When I submit the form though, my $this-data looks like: Array ( [PracticeItem] = Array ( [name] = TEST ) [PracticeInstance] = Array ( [0] = Array ( [timeminutes] = 20 [tempostart] = 120 [tempofinish] = 130 ) [1] = Array ( [timeminutes] = 40 [tempostart] = 100 [tempofinish] = 110 ) ) ) As you can see, the PracticeItem element has the first autoComplete field's data missing, and it acts as though the only bit that qualifies as [PracticeItem][name] is the last entry in the form. On 16 Apr, 15:20, Johnny Ferguson hyperfle...@gmail.com wrote: Hi, I've noticed that CakePHP has an autoComplete helper, but I'm having trouble figuring out how to make it work for my application:http://book.cakephp.org/view/632/autoComplete I have 3 controllers: PracticeItems PracticeInstances PracticeSessions A PracticeSession will have 1 or more PracticeInstances A PracticeInstance has 1 PracticeItem I'm working on the add method for PracticeSessions. This form should start with 4 fields: PracticeItem.0.name (this one is autocomplete) PracticeInstance.0.timeminutes PracticeInstance.0.tempostart PracticeInstance.0.tempofinish It shouldn't be hard to add a button that will generate another 4 fields with the value 0 incremented accordingly. My problem is that autoComplete() accepts its argument as ModelName.FieldName. I can't use the notation with a number in the middle. This means when I get back $this-data I have something like: Array ( [PracticeItem] = Array ( [name] = Another Test Item ) [PracticeInstance] = Array ( [0] = Array ( [timeminutes] = 20 [tempostart] = 100 [tempofinish] = 120 ) ) ) But what I want is Array ( [PracticeItem] = Array ( [0] = Array ( [name] = Another Test Item ) ) [PracticeInstance] = Array ( [0] = Array ( [timeminutes] = 20 [tempostart] = 100 [tempofinish] = 120 ) ) ) This would be trivial for a single entry, but as I'll be adding more form fields on the fly, I'm not sure how it will work if I can't say $ajax-autoComplete('PracticeItem.n.name', '/practice_items/ autoComplete') I'm thinking I could add an extra parameter to the autoComplete function, but since it's built in, I'm not sure how to go about this. Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Adding multiple form fields with autocomplete
So I've looked further into this, and I tried the obvious solution It seems that the items in $this-data are assigned a number from the name field of the input element. name=data[PracticeInstance][0][tempostart] means the form will feed the data back as $this- data['PracticeInstance']['0']['tempostart'] So when I created my ajax autoComplete field I tried: $ajax-autoComplete('PracticeItem.name', '/practice_items/ autoCompleteName', array('name' = 'data[PracticeItem][0][name]')); For some reason the second autocomplete field won't autocomplete. When I submit the form though, my $this-data looks like: Array ( [PracticeItem] = Array ( [name] = TEST ) [PracticeInstance] = Array ( [0] = Array ( [timeminutes] = 20 [tempostart] = 120 [tempofinish] = 130 ) [1] = Array ( [timeminutes] = 40 [tempostart] = 100 [tempofinish] = 110 ) ) ) As you can see, the PracticeItem element has the first autoComplete field's data missing, and it acts as though the only bit that qualifies as [PracticeItem][name] is the last entry in the form. On 16 Apr, 15:20, Johnny Ferguson hyperfle...@gmail.com wrote: Hi, I've noticed that CakePHP has an autoComplete helper, but I'm having trouble figuring out how to make it work for my application:http://book.cakephp.org/view/632/autoComplete I have 3 controllers: PracticeItems PracticeInstances PracticeSessions A PracticeSession will have 1 or more PracticeInstances A PracticeInstance has 1 PracticeItem I'm working on the add method for PracticeSessions. This form should start with 4 fields: PracticeItem.0.name (this one is autocomplete) PracticeInstance.0.timeminutes PracticeInstance.0.tempostart PracticeInstance.0.tempofinish It shouldn't be hard to add a button that will generate another 4 fields with the value 0 incremented accordingly. My problem is that autoComplete() accepts its argument as ModelName.FieldName. I can't use the notation with a number in the middle. This means when I get back $this-data I have something like: Array ( [PracticeItem] = Array ( [name] = Another Test Item ) [PracticeInstance] = Array ( [0] = Array ( [timeminutes] = 20 [tempostart] = 100 [tempofinish] = 120 ) ) ) But what I want is Array ( [PracticeItem] = Array ( [0] = Array ( [name] = Another Test Item ) ) [PracticeInstance] = Array ( [0] = Array ( [timeminutes] = 20 [tempostart] = 100 [tempofinish] = 120 ) ) ) This would be trivial for a single entry, but as I'll be adding more form fields on the fly, I'm not sure how it will work if I can't say $ajax-autoComplete('PracticeItem.n.name', '/practice_items/ autoComplete') I'm thinking I could add an extra parameter to the autoComplete function, but since it's built in, I'm not sure how to go about this. Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Adding multiple form fields with autocomplete
So I've looked further into this, and I tried the obvious solution It seems that the items in $this-data are assigned a number from the name field of the input element. name=data[PracticeInstance][0][tempostart] means the form will feed the data back as $this- data['PracticeInstance']['0']['tempostart'] So when I created my ajax autoComplete field I tried: $ajax-autoComplete('PracticeItem.name', '/practice_items/ autoCompleteName', array('name' = 'data[PracticeItem][0][name]')); For some reason the second autocomplete field won't autocomplete. When I submit the form though, my $this-data looks like: Array ( [PracticeItem] = Array ( [name] = TEST ) [PracticeInstance] = Array ( [0] = Array ( [timeminutes] = 20 [tempostart] = 120 [tempofinish] = 130 ) [1] = Array ( [timeminutes] = 40 [tempostart] = 100 [tempofinish] = 110 ) ) ) As you can see, the PracticeItem element has the first autoComplete field's data missing, and it acts as though the only bit that qualifies as [PracticeItem][name] is the last entry in the form. On 16 Apr, 15:20, Johnny Ferguson hyperfle...@gmail.com wrote: Hi, I've noticed that CakePHP has an autoComplete helper, but I'm having trouble figuring out how to make it work for my application:http://book.cakephp.org/view/632/autoComplete I have 3 controllers: PracticeItems PracticeInstances PracticeSessions A PracticeSession will have 1 or more PracticeInstances A PracticeInstance has 1 PracticeItem I'm working on the add method for PracticeSessions. This form should start with 4 fields: PracticeItem.0.name (this one is autocomplete) PracticeInstance.0.timeminutes PracticeInstance.0.tempostart PracticeInstance.0.tempofinish It shouldn't be hard to add a button that will generate another 4 fields with the value 0 incremented accordingly. My problem is that autoComplete() accepts its argument as ModelName.FieldName. I can't use the notation with a number in the middle. This means when I get back $this-data I have something like: Array ( [PracticeItem] = Array ( [name] = Another Test Item ) [PracticeInstance] = Array ( [0] = Array ( [timeminutes] = 20 [tempostart] = 100 [tempofinish] = 120 ) ) ) But what I want is Array ( [PracticeItem] = Array ( [0] = Array ( [name] = Another Test Item ) ) [PracticeInstance] = Array ( [0] = Array ( [timeminutes] = 20 [tempostart] = 100 [tempofinish] = 120 ) ) ) This would be trivial for a single entry, but as I'll be adding more form fields on the fly, I'm not sure how it will work if I can't say $ajax-autoComplete('PracticeItem.n.name', '/practice_items/ autoComplete') I'm thinking I could add an extra parameter to the autoComplete function, but since it's built in, I'm not sure how to go about this. Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Adding multiple form fields with autocomplete
practice_sessions_controller.php: http://pastebin.com/XHw37WS0 practice_sessions/add.ctp: http://pastebin.com/Z5fGgfxV practice_items_controller.php: (autoCompleteName) http://pastebin.com/SLN72D4T On 16 Apr, 19:38, Johnny Ferguson hyperfle...@gmail.com wrote: So I've looked further into this, and I tried the obvious solution It seems that the items in $this-data are assigned a number from the name field of the input element. name=data[PracticeInstance][0][tempostart] means the form will feed the data back as $this- data['PracticeInstance']['0']['tempostart'] So when I created my ajax autoComplete field I tried: $ajax-autoComplete('PracticeItem.name', '/practice_items/ autoCompleteName', array('name' = 'data[PracticeItem][0][name]')); For some reason the second autocomplete field won't autocomplete. When I submit the form though, my $this-data looks like: Array ( [PracticeItem] = Array ( [name] = TEST ) [PracticeInstance] = Array ( [0] = Array ( [timeminutes] = 20 [tempostart] = 120 [tempofinish] = 130 ) [1] = Array ( [timeminutes] = 40 [tempostart] = 100 [tempofinish] = 110 ) ) ) As you can see, the PracticeItem element has the first autoComplete field's data missing, and it acts as though the only bit that qualifies as [PracticeItem][name] is the last entry in the form. On 16 Apr, 15:20, Johnny Ferguson hyperfle...@gmail.com wrote: Hi, I've noticed that CakePHP has an autoComplete helper, but I'm having trouble figuring out how to make it work for my application:http://book.cakephp.org/view/632/autoComplete I have 3 controllers: PracticeItems PracticeInstances PracticeSessions A PracticeSession will have 1 or more PracticeInstances A PracticeInstance has 1 PracticeItem I'm working on the add method for PracticeSessions. This form should start with 4 fields: PracticeItem.0.name (this one is autocomplete) PracticeInstance.0.timeminutes PracticeInstance.0.tempostart PracticeInstance.0.tempofinish It shouldn't be hard to add a button that will generate another 4 fields with the value 0 incremented accordingly. My problem is that autoComplete() accepts its argument as ModelName.FieldName. I can't use the notation with a number in the middle. This means when I get back $this-data I have something like: Array ( [PracticeItem] = Array ( [name] = Another Test Item ) [PracticeInstance] = Array ( [0] = Array ( [timeminutes] = 20 [tempostart] = 100 [tempofinish] = 120 ) ) ) But what I want is Array ( [PracticeItem] = Array ( [0] = Array ( [name] = Another Test Item ) ) [PracticeInstance] = Array ( [0] = Array ( [timeminutes] = 20 [tempostart] = 100 [tempofinish] = 120 ) ) ) This would be trivial for a single entry, but as I'll be adding more form fields on the fly, I'm not sure how it will work if I can't say $ajax-autoComplete('PracticeItem.n.name', '/practice_items/ autoComplete') I'm thinking I could add an extra parameter to the autoComplete function, but since it's built in, I'm not sure how to go about this. Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to
Re: Adding multiple form fields with autocomplete
digging through the DOM further, I notice that the autocomplete form element creates a div after itself with id=PracticeItemName_autoComplete. It has the same id for each autocomplete form (which would explain why only one works), so I guess my question comes down to: How can I specify the name of this helper div when invoking the $ajax-autoComplete method? On 16 Apr, 19:41, Johnny Ferguson hyperfle...@gmail.com wrote: practice_sessions_controller.php:http://pastebin.com/XHw37WS0 practice_sessions/add.ctp:http://pastebin.com/Z5fGgfxV practice_items_controller.php: (autoCompleteName)http://pastebin.com/SLN72D4T On 16 Apr, 19:38, Johnny Ferguson hyperfle...@gmail.com wrote: So I've looked further into this, and I tried the obvious solution It seems that the items in $this-data are assigned a number from the name field of the input element. name=data[PracticeInstance][0][tempostart] means the form will feed the data back as $this- data['PracticeInstance']['0']['tempostart'] So when I created my ajax autoComplete field I tried: $ajax-autoComplete('PracticeItem.name', '/practice_items/ autoCompleteName', array('name' = 'data[PracticeItem][0][name]')); For some reason the second autocomplete field won't autocomplete. When I submit the form though, my $this-data looks like: Array ( [PracticeItem] = Array ( [name] = TEST ) [PracticeInstance] = Array ( [0] = Array ( [timeminutes] = 20 [tempostart] = 120 [tempofinish] = 130 ) [1] = Array ( [timeminutes] = 40 [tempostart] = 100 [tempofinish] = 110 ) ) ) As you can see, the PracticeItem element has the first autoComplete field's data missing, and it acts as though the only bit that qualifies as [PracticeItem][name] is the last entry in the form. On 16 Apr, 15:20, Johnny Ferguson hyperfle...@gmail.com wrote: Hi, I've noticed that CakePHP has an autoComplete helper, but I'm having trouble figuring out how to make it work for my application:http://book.cakephp.org/view/632/autoComplete I have 3 controllers: PracticeItems PracticeInstances PracticeSessions A PracticeSession will have 1 or more PracticeInstances A PracticeInstance has 1 PracticeItem I'm working on the add method for PracticeSessions. This form should start with 4 fields: PracticeItem.0.name (this one is autocomplete) PracticeInstance.0.timeminutes PracticeInstance.0.tempostart PracticeInstance.0.tempofinish It shouldn't be hard to add a button that will generate another 4 fields with the value 0 incremented accordingly. My problem is that autoComplete() accepts its argument as ModelName.FieldName. I can't use the notation with a number in the middle. This means when I get back $this-data I have something like: Array ( [PracticeItem] = Array ( [name] = Another Test Item ) [PracticeInstance] = Array ( [0] = Array ( [timeminutes] = 20 [tempostart] = 100 [tempofinish] = 120 ) ) ) But what I want is Array ( [PracticeItem] = Array ( [0] = Array ( [name] = Another Test Item ) ) [PracticeInstance] = Array ( [0] = Array ( [timeminutes] = 20 [tempostart] = 100 [tempofinish] = 120 ) ) ) This would be trivial for a single entry, but as I'll be adding more form fields on the fly, I'm not sure how it will work if I can't say $ajax-autoComplete('PracticeItem.n.name', '/practice_items/ autoComplete') I'm thinking I could add an extra parameter to the autoComplete function, but since it's built in, I'm not sure how to go about this. Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group,
Re: Adding multiple form fields with autocomplete
I can edit the name of the helper div with the 'div_id' option, but it doesn't seem to let both fields use the autocomplete function. At this point, I'm not sure how to diagnose the issue any further. On 16 Apr, 19:48, Johnny Ferguson hyperfle...@gmail.com wrote: digging through the DOM further, I notice that the autocomplete form element creates a div after itself with id=PracticeItemName_autoComplete. It has the same id for each autocomplete form (which would explain why only one works), so I guess my question comes down to: How can I specify the name of this helper div when invoking the $ajax-autoComplete method? On 16 Apr, 19:41, Johnny Ferguson hyperfle...@gmail.com wrote: practice_sessions_controller.php:http://pastebin.com/XHw37WS0 practice_sessions/add.ctp:http://pastebin.com/Z5fGgfxV practice_items_controller.php: (autoCompleteName)http://pastebin.com/SLN72D4T On 16 Apr, 19:38, Johnny Ferguson hyperfle...@gmail.com wrote: So I've looked further into this, and I tried the obvious solution It seems that the items in $this-data are assigned a number from the name field of the input element. name=data[PracticeInstance][0][tempostart] means the form will feed the data back as $this- data['PracticeInstance']['0']['tempostart'] So when I created my ajax autoComplete field I tried: $ajax-autoComplete('PracticeItem.name', '/practice_items/ autoCompleteName', array('name' = 'data[PracticeItem][0][name]')); For some reason the second autocomplete field won't autocomplete. When I submit the form though, my $this-data looks like: Array ( [PracticeItem] = Array ( [name] = TEST ) [PracticeInstance] = Array ( [0] = Array ( [timeminutes] = 20 [tempostart] = 120 [tempofinish] = 130 ) [1] = Array ( [timeminutes] = 40 [tempostart] = 100 [tempofinish] = 110 ) ) ) As you can see, the PracticeItem element has the first autoComplete field's data missing, and it acts as though the only bit that qualifies as [PracticeItem][name] is the last entry in the form. On 16 Apr, 15:20, Johnny Ferguson hyperfle...@gmail.com wrote: Hi, I've noticed that CakePHP has an autoComplete helper, but I'm having trouble figuring out how to make it work for my application:http://book.cakephp.org/view/632/autoComplete I have 3 controllers: PracticeItems PracticeInstances PracticeSessions A PracticeSession will have 1 or more PracticeInstances A PracticeInstance has 1 PracticeItem I'm working on the add method for PracticeSessions. This form should start with 4 fields: PracticeItem.0.name (this one is autocomplete) PracticeInstance.0.timeminutes PracticeInstance.0.tempostart PracticeInstance.0.tempofinish It shouldn't be hard to add a button that will generate another 4 fields with the value 0 incremented accordingly. My problem is that autoComplete() accepts its argument as ModelName.FieldName. I can't use the notation with a number in the middle. This means when I get back $this-data I have something like: Array ( [PracticeItem] = Array ( [name] = Another Test Item ) [PracticeInstance] = Array ( [0] = Array ( [timeminutes] = 20 [tempostart] = 100 [tempofinish] = 120 ) ) ) But what I want is Array ( [PracticeItem] = Array ( [0] = Array ( [name] = Another Test Item ) ) [PracticeInstance] = Array ( [0] = Array ( [timeminutes] = 20 [tempostart] = 100 [tempofinish] = 120 ) ) ) This would be trivial for a single entry, but as I'll be adding more form fields on the fly, I'm not sure how it will work if I can't say $ajax-autoComplete('PracticeItem.n.name', '/practice_items/ autoComplete') I'm thinking I could add an extra parameter to the autoComplete function, but since it's built in, I'm not sure how to go about this. Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpotherswith their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this
Re: the plugins dont work at all
Neither of you are correct, or are referring to the wrong thing. @jacmoe - Its /root_url/plugin_name/plugin_controller/plugin_action/ not /root_url/plugin_name/plugin_action/. And I quote the book: Once a plugin has been installed in /app/ plugins, you can access it at the URL /pluginname/controllername/ action. In our pizza ordering plugin example, we'd access our PizzaOrdersController at /pizza/pizzaOrders. @AD7Six - Prove me wrong? You cant go to /plugin_name/ and have it work without defining the controller in the URL or setting up a route to match it. I ran into this exact problem with my forum plugin, so I have test cased it. On Apr 16, 4:22 pm, jacmoe jac...@mail.dk wrote: If you read the book, it is indeed root_url/plugin_name/plugin_action, so check your sources before you're telling people that they are telling the wrong thing. :) http://book.cakephp.org/view/1113/Plugin-Controllers On Apr 16, 9:47 pm, AD7six andydawso...@gmail.com wrote: On Apr 16, 9:39 pm, Miles J mileswjohn...@gmail.com wrote: You are doing it wrong, the URLs would be like so: domain.com/controller/action/ domain.com/plugin/controller/action/ You cant go to domain.com/plugin/ and have it work without setting up routes. Since when. I'd suggest checking the book and/or test cases before telling people they're doing it wrong. Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: the plugins dont work at all
I think you'll find in CakePHP 1.2, a controller name that matches the plugin name will route fine as: /root/:plugin/:action as long as :controller is the same string as :plugin Cheers, Graham Weldon e. gra...@grahamweldon.com p. +61 407 017 293 w. http://grahamweldon.com On 17/04/2010, at 12:20 PM, Miles J wrote: Neither of you are correct, or are referring to the wrong thing. @jacmoe - Its /root_url/plugin_name/plugin_controller/plugin_action/ not /root_url/plugin_name/plugin_action/. And I quote the book: Once a plugin has been installed in /app/ plugins, you can access it at the URL /pluginname/controllername/ action. In our pizza ordering plugin example, we'd access our PizzaOrdersController at /pizza/pizzaOrders. @AD7Six - Prove me wrong? You cant go to /plugin_name/ and have it work without defining the controller in the URL or setting up a route to match it. I ran into this exact problem with my forum plugin, so I have test cased it. On Apr 16, 4:22 pm, jacmoe jac...@mail.dk wrote: If you read the book, it is indeed root_url/plugin_name/plugin_action, so check your sources before you're telling people that they are telling the wrong thing. :) http://book.cakephp.org/view/1113/Plugin-Controllers On Apr 16, 9:47 pm, AD7six andydawso...@gmail.com wrote: On Apr 16, 9:39 pm, Miles J mileswjohn...@gmail.com wrote: You are doing it wrong, the URLs would be like so: domain.com/controller/action/ domain.com/plugin/controller/action/ You cant go to domain.com/plugin/ and have it work without setting up routes. Since when. I'd suggest checking the book and/or test cases before telling people they're doing it wrong. Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: the plugins dont work at all
thanks every one it's just work great for me at this way appName/pluginName/Controller/action i was get it wrong on the book thanks. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Error Massage in the tutorial
In the Tutorial of the Cookbook (the blog tutorial) I get following error message after the step 10.1.3 Cake Database Configuration: ## Warning (2): strtotime() [http://php.net/function.strtotime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '2.0/DST' instead [CORE\cake \libs\cache.php, line 570] Code | Context $settings = array( engine = File, path = C:\Programme\Apache Software Foundation\Apache2.2\htdocs \cake\app\tmp\cache\persistent\, prefix = cake_core_, lock = false, serialize = true, isWindows = true, duration = +10 seconds, probability = 100 ) strtotime - [internal], line ?? CacheEngine::init() - CORE\cake\libs\cache.php, line 570 FileEngine::init() - CORE\cake\libs\cache\file.php, line 81 Cache::_buildEngine() - CORE\cake\libs\cache.php, line 151 Cache::config() - CORE\cake\libs\cache.php, line 126 Configure::__loadBootstrap() - CORE\cake\libs\configure.php, line 420 Configure::getInstance() - CORE\cake\libs\configure.php, line 52 include - CORE\cake\bootstrap.php, line 38 require - APP\webroot\index.php, line 76 [main] - CORE\index.php, line 55 ## I'me using Apache 2.2 on Windows XP, PHP 5.3.2, MySQL 5.0.7. Can anybody help me and tell me what's wrong here. Thanks Cake-it Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
composite keys to identify a record
Dear, Someone must have encountered a situation where a table had with composite key. what did you do? Since CakePHP recognizes only one field to primaryKey! In my opinion I see two possibilities: 1 - not create tables with composite keys. When you need to use composite keys to identify a record, create one more field with the name ID and put it as primary key. 2 - forget standardization. Choose one of the fields to put in $ primaryKey attribute of the model and when you need to make a relationship (or hasMany belongsTo), use to specify the conditions other fields that make up the key of the table. That's my opinion, please tell her! Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Logout users
Is it possible to get a list of users that are currently logged into the system? I'd like to be able to log them out if I'm performing maintenance on the system or even just the ability to log a single user out for any reason. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Model and Controller aliases
I would rather put the descriptions in the comments, especially if you only use it when reviewing the files. # Hendry On Sat, Apr 17, 2010 at 1:59 AM, Scott scott.bent...@gmail.com wrote: Some of my model and controller classes have very long, and therefore descriptive, names. The problem is that it's a real pain to use these when coding, but I want the names to be as descriptive as possible when reviewing the files. It would be really nice if we could define an alias that could be used instead of the full model/controller name when calling actions. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: composite keys to identify a record
I absolutely endorse a single, incremental, non-intelligent primary key, enriched with multi-field unique indexes and the adoption of convention. Why make life any more difficult than it is already? Jeremy Burns jeremybu...@me.com On 16 Apr 2010, at 21:29, Renan Augusto wrote: Dear, Someone must have encountered a situation where a table had with composite key. what did you do? Since CakePHP recognizes only one field to primaryKey! In my opinion I see two possibilities: 1 - not create tables with composite keys. When you need to use composite keys to identify a record, create one more field with the name ID and put it as primary key. 2 - forget standardization. Choose one of the fields to put in $ primaryKey attribute of the model and when you need to make a relationship (or hasMany belongsTo), use to specify the conditions other fields that make up the key of the table. That's my opinion, please tell her! Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en