CakeFest 2010 - Last chance for cheap tickets!
The End is Nigh! (for early-bird ticket pricing) CakeFest has always offered cheaper tickets for those that purchase as early as possible. This year, the early bird ticketing finishes on the 24th July. Following the 24th, ticket prices will be raising to cover the additional logistical cost, and passthrough cost for event management and venue booking to cover attendees. This is a perfect opportunity to take advantage of the cheaper prices before they raise on July 25th. For more information on ticketing and pricing, please visit the ticket information page. Note that accommodation options offered position you at the same venue as the core developers and the event itself, ensuring the most cost effective price and the best CakeFest conference experience available! If you have any questions regarding tickets, accommodation, pricing or anything else, please feel free to contact us for more information. View the full schedule here: http://cakefest.org/schedule Score a free iPad Recently leaked information was cropping up on Twitter announcing that we are giving away an iPad at CakeFest. While we had hoped to keep this information under wraps until the event was underway, however we are required to address to rumours. CakeFest 2010 will indeed involve the giveaway of an Apple iPad device. This will be a random pool from the attendee! Thats right, just by having purchased a ticket, you will be eligible to win an Apple iPad on the conference days. The winner is required to be onsite at the announcement to collect the iPad, or another winner will be randomly selected from the pool of attendees. Ticket information: http://cakefest.org/ticket-info Purchase tickets from your account dashboard: http://cakefest.org/profile If you have any questions, or want some information about the CakeFest event, or sponsorship, please drop me an email! Cheers, Graham Weldon (AKA: Predominant) 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: Unicode problem between controller and view
Thanks for the info Kirk! I'll be using this as well in the future. -- Louie Miranda - Email: lmira...@gmail.com - Web: http://www.louiemiranda.com On Wed, Jul 21, 2010 at 10:14 AM, Kirk k...@kirkkahn.com wrote: I thought it might get annoying... my conversation with myself. But I hope it helps someone! On Tue, Jul 20, 2010 at 7:47 PM, MattyHead mattyh...@gmail.com wrote: Thank you for posting your whole experience with this! And congratulations for figuring it out so quickly. Cheers, Matt On Tue, Jul 20, 2010 at 7:15 PM, Kirk k...@kirkkahn.com wrote: i found the solution here: http://www.jotlab.com/2009/03/03/cakephp-utf-8/ all you have to do is add 'encoding' = 'UTF8' to database.php doh! On Tue, Jul 20, 2010 at 6:59 PM, Kirk k...@kirkkahn.com wrote: And the plot thickens... If I change the character encoding in core.php to: Configure::write('App.encoding', 'ISO-8859-1'); Then suddenly the text shows up correctly. Which means that even though I'm specifying UTF-8 as the character encoding, cake is still using ISO-8859-1 (or Windows-1252?) encoding while saying that it's using UTF-8. How frustrating! On Tue, Jul 20, 2010 at 6:17 PM, Kirk k...@kirkkahn.com wrote: As an extra piece of information, if I specify the escape option as 'ISO-8859-1' in the link method of the html helper ( http://book.cakephp.org/view/1442/link), the non-ascii characters are substituted for html entities, and it renders fine (without the little question marks). (I am using Windows, btw) On Tue, Jul 20, 2010 at 5:37 PM, Kirk k...@kirkkahn.com wrote: I thought someone here may have some experience with this. I fetch utf-8 data from a mysql db using: $this-data = find('all',$options); From within the controller, if I debug($this-data), I get something like: [1] = Array ( [Subdivision] = Array ( [name] = Aïn Témouchent ) But if I debug($this-data) in the view, I get something like: [1] = Array ( [Subdivision] = Array ( [name] = A�n T�mouchent ) The non-ascii characters don't show up correctly. I can't figure out why this is happening. In my core.php, I have the following option: Configure::write('App.encoding', 'UTF-8'); I'm not sure what else I need to check. Any help would be greatly appreciated. Thanks, ~Kirk 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.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: CakePHP 1.3.2 Pagination Error under Plugin
Try changing from: class ClientsController extends CoreAppController to: class ClientsController extends AppController -- Louie Miranda - Email: lmira...@gmail.com - Web: http://www.louiemiranda.com On Wed, Jul 21, 2010 at 1:30 PM, Bryan de Asis bryandea...@gmail.comwrote: I'm having errors when trying to execute Pagination I'm not having this kind of problem on version 1.2.x: Warning (4096): Object of class JsHelper could not be converted to string [CORE/cake/libs/view/helpers/javascript.php, line 259] Notice (8): Object of class JsHelper to string conversion [CORE/cake/ libs/view/helpers/javascript.php, line 259] Fatal error: Cannot use object of type JsHelper as array in /home/ bdeasis/lib/cakephp-1.3.2/cake/libs/view/helpers/javascript.php on line 260 And this is my controller look like: class ClientsController extends CoreAppController { public $name = 'Clients'; public $paginate = array( 'limit' = 1, 'order' = array( 'Client.created, Client.modified'='DESC' ) ); public function beforeFilter() { parent::beforeFilter(); } public function index() { $data = $this-paginate('Client'); $this-set('data',compact('data')); } } but if I comment $data = $this-paginate('Client'); or just using find it is working fine. i think it is in the paginate method. Can any one help me... Thanks... Bryan de Asis 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: Phrase inflections
http://book.cakephp.org/view/953/Inflections Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 20 Jul 2010, at 18:36, desheffer wrote: I have a model called LeaveOfAbsence. The proper English name for the pluralized controller would be LeavesOfAbsence rather than LeaveOfAbsences (similar to the plural mothers-in-law). Does anyone know to set up inflections for this specific case? It seems that CakePHP only looks at the last word in the phrase, never the entire phrase. 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: Email Component
Have you tried clearing the cache (/app/tmp/cache/...and sub folders)? Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 21 Jul 2010, at 03:06, Hugo M wrote: Mm... if you have Linux you can check in /etc/php5/apache2/php.ini the sendmail configuration and the sendmail path. Maybe is put as a relative path (I don't see a good reason to do that but... who knows :P) 2010/7/20 Ed Propsner crotchf...@gmail.com Nope, nothing. I originally used it right out of the box and I didn't have to change a thing. It was working perfectly until I changed to a new dir on my server. It really makes no sense. On Tue, Jul 20, 2010 at 8:49 PM, Hugo M ham1...@gmail.com wrote: Strange, do you have any configuration related with Email component? if I can send mail with mail() I can send with the component :S 2010/7/20 Ed Propsner crotchf...@gmail.com I recently changed names on one of my sites and moved the entire site to a different dir on the server. Everything went smooth enough except now I'm unable to send emails. Mail sends ok using PHP mail() function but not when using the email component. The email is NOT set up for SMTP. Am I overlooking something here? I'm not sure what the problem 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 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 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: Cannot send the email to more than one recipient.
Thank you for all suggestion. I used SwiftMailer with Cake 1.1 and now I'm trying email component in Cake 1.2 The reason I'm going to send email to many recipient because we're testing the system. In production, I agreed it's very bad idea to put them all in to. Now, I'm just wonder how to configure the system to allow send them all in to. I'm using Redhat to run PHP and Microsoft Exchange Server 2007 for SMTP server. Thanks again. 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
calling method passing employee_id variable
Im having a real noob time with this! Im trying to refine the information that is represented in an index based on the selection from a combo box which has a list of employees. The user selects the employee they want, clicks go and view then gets refined to all records associated to that employee_id. so in my controller I have function filter($filter_id = null){ $filterQuery = $this-Lead-find('all', array( 'conditions'=array( 'Lead.employee_id' = $filter_id))); $this-set-('filterQuery', $filterQuery); and my index view I have ?php echo $form-input('employee', array ('label' = '', 'type' = 'select', 'options' = array($employee), ));? ?php echo $form-end('Go');? Do i need to link that action to a comnpletely different view eg filter.ctp? How do i call the method and pass the id? Please help! 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: calling method passing employee_id variable
Ok, this setup will give you a post-redirect-get mechanism. You could also forgo the requirement for the id to be passed as a parameter, and just use the posted data[] - this would avoid the redirect. Some kind of validation would be good to add, too. View: ?php echo $form-create('Lead', array('action' = 'filter')); echo $form-input(...); echo $form-end('Go'); ? Controller: function filter($filter_id = null) { if (empty($filter_id) !empty($this-data['Lead']['employee'])) { $this-redirect(array('action' = 'filter', $this-data['Lead'] ['employee'])); } // Rest of code here } hth grigri On Jul 21, 10:20 am, james jamesliv...@googlemail.com wrote: Im having a real noob time with this! Im trying to refine the information that is represented in an index based on the selection from a combo box which has a list of employees. The user selects the employee they want, clicks go and view then gets refined to all records associated to that employee_id. so in my controller I have function filter($filter_id = null){ $filterQuery = $this-Lead-find('all', array( 'conditions'=array( 'Lead.employee_id' = $filter_id))); $this-set-('filterQuery', $filterQuery); and my index view I have ?php echo $form-input('employee', array ('label' = '', 'type' = 'select', 'options' = array($employee), ));? ?php echo $form-end('Go');? Do i need to link that action to a comnpletely different view eg filter.ctp? How do i call the method and pass the id? Please help! 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 plugin Helpers in main app doesn't seem to work
Don't know if its me or cake, but I can't get a helper from the plugin to load in the main app. plugin helper is in /plugins/pluginname/views/helpers/helpername.php class HelpernameHelper extends PluginnameAppHelper { function out(){ return $this-output('testing out method from plugin'); } } in app app_controller var $helpers = array('Pluginname.Helpername'); in app default layout ? echo $helpername-out();? error I'm getting is Undefined variable $helpername in default.ctp Fatal Error: call to function out() on a non-object. Anyone see 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
Re: calling method passing employee_id variable
Thanks grigiri - i'll get on it! out of interest, how would that be accomplished by usnig the data[] instead of passing the id parameter? It would be useful i guess to avoid the redirect every time if possible On 21 July, 10:27, grigri j...@hendersonwebdesign.com wrote: Ok, this setup will give you a post-redirect-get mechanism. You could also forgo the requirement for the id to be passed as a parameter, and just use the posted data[] - this would avoid the redirect. Some kind of validation would be good to add, too. View: ?php echo $form-create('Lead', array('action' = 'filter')); echo $form-input(...); echo $form-end('Go'); ? Controller: function filter($filter_id = null) { if (empty($filter_id) !empty($this-data['Lead']['employee'])) { $this-redirect(array('action' = 'filter', $this-data['Lead'] ['employee'])); } // Rest of code here } hth grigri On Jul 21, 10:20 am, james jamesliv...@googlemail.com wrote: Im having a real noob time with this! Im trying to refine the information that is represented in an index based on the selection from a combo box which has a list of employees. The user selects the employee they want, clicks go and view then gets refined to all records associated to that employee_id. so in my controller I have function filter($filter_id = null){ $filterQuery = $this-Lead-find('all', array( 'conditions'=array( 'Lead.employee_id' = $filter_id))); $this-set-('filterQuery', $filterQuery); and my index view I have ?php echo $form-input('employee', array ('label' = '', 'type' = 'select', 'options' = array($employee), ));? ?php echo $form-end('Go');? Do i need to link that action to a comnpletely different view eg filter.ctp? How do i call the method and pass the id? Please help! 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
Unknown Problem
I have deployed my cake application running on the following url socialbidz.com/sb/sb i have got a serious problem when i keep the debug mode to 0 its display the requwsted url is available on this server, and when i set the debug to 2 then it is ok and displaying everything, any solution. 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 plugin Helpers in main app doesn't seem to work
cake1.3? try ?php echo $this-Helpername-out();? On 21 Jul., 11:35, kadanis evad.ba...@gmail.com wrote: Don't know if its me or cake, but I can't get a helper from the plugin to load in the main app. plugin helper is in /plugins/pluginname/views/helpers/helpername.php class HelpernameHelper extends PluginnameAppHelper { function out(){ return $this-output('testing out method from plugin'); } } in app app_controller var $helpers = array('Pluginname.Helpername'); in app default layout ? echo $helpername-out();? error I'm getting is Undefined variable $helpername in default.ctp Fatal Error: call to function out() on a non-object. Anyone see 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
Re: calling method passing employee_id variable
Pretty much this: function filter($filter_id = null) { if (empty($filter_id) !empty($this-data['Lead']['employee'])) { $filter_id = $this-data['Lead']['employee']; } // Rest of code here } hth grigri On Jul 21, 11:00 am, james jamesliv...@googlemail.com wrote: Thanks grigiri - i'll get on it! out of interest, how would that be accomplished by usnig the data[] instead of passing the id parameter? It would be useful i guess to avoid the redirect every time if possible On 21 July, 10:27, grigri j...@hendersonwebdesign.com wrote: Ok, this setup will give you a post-redirect-get mechanism. You could also forgo the requirement for the id to be passed as a parameter, and just use the posted data[] - this would avoid the redirect. Some kind of validation would be good to add, too. View: ?php echo $form-create('Lead', array('action' = 'filter')); echo $form-input(...); echo $form-end('Go'); ? Controller: function filter($filter_id = null) { if (empty($filter_id) !empty($this-data['Lead']['employee'])) { $this-redirect(array('action' = 'filter', $this-data['Lead'] ['employee'])); } // Rest of code here } hth grigri On Jul 21, 10:20 am, james jamesliv...@googlemail.com wrote: Im having a real noob time with this! Im trying to refine the information that is represented in an index based on the selection from a combo box which has a list of employees. The user selects the employee they want, clicks go and view then gets refined to all records associated to that employee_id. so in my controller I have function filter($filter_id = null){ $filterQuery = $this-Lead-find('all', array( 'conditions'=array( 'Lead.employee_id' = $filter_id))); $this-set-('filterQuery', $filterQuery); and my index view I have ?php echo $form-input('employee', array ('label' = '', 'type' = 'select', 'options' = array($employee), ));? ?php echo $form-end('Go');? Do i need to link that action to a comnpletely different view eg filter.ctp? How do i call the method and pass the id? Please help! 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
Inflections + Naming Conventions Generator?
Does anyone know of a site that would allow you to enter a word or two (something you'd use for a table name) and then spits out a list of the inflections and where each one should be used (ie: the corresponding file name, URL, object name, etc) following cake naming conventions? Or if you enter two give you the habtm key field names and joining table name? I can see something like this being really useful for new cake users like myself. Not that I haven't picked it up fairly easy but there are still places where I simply guess which inflection to use then change it when things don't work. The conventions page does a good job of explaining but interactive = better ;) 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 plugin Helpers in main app doesn't seem to work
thanks for the reply oops. yeah 1.3, sorry forgot to mention that. tried ?php echo $this-Helpername-out();? error now : Undefined property View::$Helpername Fatal Error: call to function out() on a non-object. Any other suggestions? 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
[solved] Re: Using plugin Helpers in main app doesn't seem to work
my bad. I have changed the helper in my plugin from class HelpernameHelper extends PluginnameAppHelper { to class HelpernameHelper extends AppHelper { and it seems to work now... 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: Email Component
I played around a little more and found a few things online that got me pointed in the right direction however things still aren't working correctly. $this-email-from = 'Some Name SomeSite.com' // email does not send at all $this-email-from = 'Some Name somesite.com' (email all lowercase) // ignores both email and name and sends using server address $this-email-from = 'Some Name' // sends okay but is obviously missing the email address On Tue, Jul 20, 2010 at 5:36 PM, Ed Propsner crotchf...@gmail.com wrote: I recently changed names on one of my sites and moved the entire site to a different dir on the server. Everything went smooth enough except now I'm unable to send emails. Mail sends ok using PHP mail() function but not when using the email component. The email is NOT set up for SMTP. Am I overlooking something here? I'm not sure what the problem 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
Using Variables (data from db) in Controller
Hi, I'm new to CakePHP. I'm working on a project using it and so far I love it, but I have a question. I have created my database, and the tables, filled in some sample data, and used cake bake all for each of my tables. Everything worked great, my table relationships were all configured correctly because I followed the Cake naming conventions. There are Submissions, that belong to a Job. (a submission has a job_id) In my submissions controller, I want to retrieve the job_id. Here is the code: $temp = $this-Submission-Job-id;//this does not work $temp = $this-Submission-Job; // this however DOES return the Job object??? (i think) $temp = $this-Submission-id; // this does return the Submission ID $temp = $this-Submission-job_id; //this does not work though... These were tried in the function: function delete($id = null) { } 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
$useTable = false - ignored
Hello. I'm developing applications with user's and content's groups based on ACL trees. In my app I have 2 models without any tables. Models are used because I want to use automatic validation. First model is for ContactsController. There is no table used, so I set Contact:: $useTable to false and everything is working just fine. Second model is used to validate the GroupsController edit form. After validation ACL's Aco Tree or both Aro and Aco Trees are updated (users are in both trees, contents in aco only) using separate Aco and Aro objects. I set useTable to false here too, but when using $this-Group- validates() Cake yells Table ncube.groups doesn't exist (...) Query: SELECT COUNT(*) AS `count` FROM `groups` AS `Group` WHERE `Group`.`id` = '7' . I don't know if it's important but my table prefix is also ignored here. There was no warning when Group:: $validate was an empty array. As a work around I put '@' before $this-Group-validates() . The controller itself is working just fine. Data are validated and saved properly. I don't know where to look for bugs. P.S. Sorry for my english. 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: translate behavior: no join for default language?
I would make the data schema design the same or consistent regardless of the language. Anytime you introduce a special case to your design you really complicate the supporting code for reading, writing and displaying the data. You'll end up doing all kinds of conditional checking for that one special case. So the direct answer to your question is yes it can be done, but the how to do it is going to unnecessarily complicate the code. And from a users stand point they won't see or appreciate the more complex design because from their point of view both designs would be viewed the same. If you need a default language make this a site setting not a hard design structure in the schema. On Jul 20, 3:58 am, M mask1...@gmail.com wrote: for example, i have posts table and i18n table. posts table already have data in english so i created data of the other language in i18n. i was wondering if there's a way to retrieve data from posts table when language is english. or do i have to create english data in i18n table? 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: $useTable = false - ignored
Try setting the $schema variable in the model. On Wed, Jul 21, 2010 at 8:55 AM, Xander a.ciesiolkiew...@gmail.com wrote: Hello. I'm developing applications with user's and content's groups based on ACL trees. In my app I have 2 models without any tables. Models are used because I want to use automatic validation. First model is for ContactsController. There is no table used, so I set Contact:: $useTable to false and everything is working just fine. Second model is used to validate the GroupsController edit form. After validation ACL's Aco Tree or both Aro and Aco Trees are updated (users are in both trees, contents in aco only) using separate Aco and Aro objects. I set useTable to false here too, but when using $this-Group- validates() Cake yells Table ncube.groups doesn't exist (...) Query: SELECT COUNT(*) AS `count` FROM `groups` AS `Group` WHERE `Group`.`id` = '7' . I don't know if it's important but my table prefix is also ignored here. There was no warning when Group:: $validate was an empty array. As a work around I put '@' before $this-Group-validates() . The controller itself is working just fine. Data are validated and saved properly. I don't know where to look for bugs. P.S. Sorry for my english. 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: Unknown Problem
On Wed, Jul 21, 2010 at 6:46 AM, mirfan m.irfa...@gmail.com wrote: I have deployed my cake application running on the following url socialbidz.com/sb/sb i have got a serious problem when i keep the debug mode to 0 its display the requwsted url is available on this server, and when i set the debug to 2 then it is ok and displaying everything, any solution. Try deleting everything in tmp/cache/models and /tmp/cache/views directories. 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 Variables (data from db) in Controller
On Wed, Jul 21, 2010 at 9:51 AM, Mad Stacks madstacksofc...@gmail.com wrote: Hi, I'm new to CakePHP. I'm working on a project using it and so far I love it, but I have a question. I have created my database, and the tables, filled in some sample data, and used cake bake all for each of my tables. Everything worked great, my table relationships were all configured correctly because I followed the Cake naming conventions. There are Submissions, that belong to a Job. (a submission has a job_id) In my submissions controller, I want to retrieve the job_id. Here is the code: $temp = $this-Submission-Job-id; //this does not work $temp = $this-Submission-Job; // this however DOES return the Job object??? (i think) $temp = $this-Submission-id; // this does return the Submission ID $temp = $this-Submission-job_id; //this does not work though... These were tried in the function: function delete($id = null) { } function delete($id = null) { if (empty($id)) { $this-Session-flash(...); } $data = $this-Submission-read(null, $id); ... } You should then be able to get the Job id from either $data['Submission']['id'] or $data['Job']['id']. 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: Unknown Problem
It may happen because of use debug functions in code (some people here reported it). If at debug=0 site do not work, then you set debug to 1 or 2 and it works, then change back to 0 and it still works - it's definitely caches as Cricket told. On Jul 21, 5:46 pm, mirfan m.irfa...@gmail.com wrote: I have deployed my cake application running on the following url socialbidz.com/sb/sb i have got a serious problem when i keep the debug mode to 0 its display the requwsted url is available on this server, and when i set the debug to 2 then it is ok and displaying everything, any solution. 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: $useTable = false - ignored
Ignored model properties and methods in 99.9% of cases is wrong model filename so it is not loaded at all. On Jul 21, 8:55 pm, Xander a.ciesiolkiew...@gmail.com wrote: Hello. I'm developing applications with user's and content's groups based on ACL trees. In my app I have 2 models without any tables. Models are used because I want to use automatic validation. First model is for ContactsController. There is no table used, so I set Contact:: $useTable to false and everything is working just fine. Second model is used to validate the GroupsController edit form. After validation ACL's Aco Tree or both Aro and Aco Trees are updated (users are in both trees, contents in aco only) using separate Aco and Aro objects. I set useTable to false here too, but when using $this-Group-validates() Cake yells Table ncube.groups doesn't exist (...) Query: SELECT COUNT(*) AS `count` FROM `groups` AS `Group` WHERE `Group`.`id` = '7' . I don't know if it's important but my table prefix is also ignored here. There was no warning when Group:: $validate was an empty array. As a work around I put '@' before $this-Group-validates() . The controller itself is working just fine. Data are validated and saved properly. I don't know where to look for bugs. P.S. Sorry for my english. 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: $useTable = false - ignored
I'm sure both model's classname and filename are correct, otherwise validation wouldn't work at all. I tripple checked if I didn't made model's name plural or something - just for case. On 21 Lip, 19:41, Dr. Loboto drlob...@gmail.com wrote: Ignored model properties and methods in 99.9% of cases is wrong model filename so it is not loaded at all. On Jul 21, 8:55 pm, Xander a.ciesiolkiew...@gmail.com wrote: Hello. I'm developing applications with user's and content's groups based on ACL trees. In my app I have 2 models without any tables. Models are used because I want to use automatic validation. First model is for ContactsController. There is no table used, so I set Contact:: $useTable to false and everything is working just fine. Second model is used to validate the GroupsController edit form. After validation ACL's Aco Tree or both Aro and Aco Trees are updated (users are in both trees, contents in aco only) using separate Aco and Aro objects. I set useTable to false here too, but when using $this-Group-validates() Cake yells Table ncube.groups doesn't exist (...) Query: SELECT COUNT(*) AS `count` FROM `groups` AS `Group` WHERE `Group`.`id` = '7' . I don't know if it's important but my table prefix is also ignored here. There was no warning when Group:: $validate was an empty array. As a work around I put '@' before $this-Group-validates() . The controller itself is working just fine. Data are validated and saved properly. I don't know where to look for bugs. P.S. Sorry for my english. 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: $useTable = false - ignored
Actually I tried, but I'm not sure if I did it correctly. Here's my model: ?php class Group extends AppModel { var $name = 'Group'; // var $useTable = 'aros'; var $useTable = false; var $_schema = array( 'id' = array( 'type' = 'integer', 'key' = 'primary', 'length' = 11 ), 'parent' = array( 'type' = 'integer', 'length' = 11 ), 'alias' = array( 'type' = 'string', 'length' = 255 ) ); var $validate = array( 'alias' = array( 'alphaNumeric' = array( 'rule' = 'alphaNumeric', 'message' = 'Pole zawiera niedozwolone znaki' ), 'notEmpty' = array( 'rule' = 'notEmpty', 'message' = 'Pole nie może być puste', ), 'between' = array( 'rule' = array('between', 5, 255), 'message' = 'Pole musi zawierać od 5 do 255 znaków', ) ), 'parent' = array( 'notEmpty' = array( 'rule' = 'notEmpty', 'message' = 'Pole nie może być puste', ) ) ); } On 21 Lip, 18:28, Nabil Alsharif bli...@gmail.com wrote: Try setting the $schema variable in the model. On Wed, Jul 21, 2010 at 8:55 AM, Xander a.ciesiolkiew...@gmail.com wrote: Hello. I'm developing applications with user's and content's groups based on ACL trees. In my app I have 2 models without any tables. Models are used because I want to use automatic validation. First model is for ContactsController. There is no table used, so I set Contact:: $useTable to false and everything is working just fine. Second model is used to validate the GroupsController edit form. After validation ACL's Aco Tree or both Aro and Aco Trees are updated (users are in both trees, contents in aco only) using separate Aco and Aro objects. I set useTable to false here too, but when using $this-Group- validates() Cake yells Table ncube.groups doesn't exist (...) Query: SELECT COUNT(*) AS `count` FROM `groups` AS `Group` WHERE `Group`.`id` = '7' . I don't know if it's important but my table prefix is also ignored here. There was no warning when Group:: $validate was an empty array. As a work around I put '@' before $this-Group-validates() . The controller itself is working just fine. Data are validated and saved properly. I don't know where to look for bugs. P.S. Sorry for my english. 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: Unknown Problem
On Wed, Jul 21, 2010 at 1:39 PM, Dr. Loboto drlob...@gmail.com wrote: It may happen because of use debug functions in code (some people here reported it). Great point. Being one of those who have brought that up here before, I should have thought of that. If one has any code using Debugger class methods, Cake will crap out if debug is set to 0. If at debug=0 site do not work, then you set debug to 1 or 2 and it works, then change back to 0 and it still works - it's definitely caches as Cricket told. That's what seems to have happened a few times to me when updating parts of an app that's in production. Suddenly, I get a fatal error. Switching to debug = 2, relaoding, and switching back to 0 fixed it. It turned out that the cache just needed to be emptied. Very confusing. 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: $useTable = false - ignored
On Wed, Jul 21, 2010 at 9:55 AM, Xander a.ciesiolkiew...@gmail.com wrote: Second model is used to validate the GroupsController edit form. After validation ACL's Aco Tree or both Aro and Aco Trees are updated (users are in both trees, contents in aco only) using separate Aco and Aro objects. I set useTable to false here too, but when using $this-Group- validates() Cake yells Table ncube.groups doesn't exist (...) You cannot associate a model with ARO or ACO if there are no records for it in the DB. You must have a groups table so that groups.id key can be included in aros table. 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
login generates malformed sql query
My automagic login function is generating malformed sql queries, for example: SELECT FROM `users` AS `User` WHERE `User`.`username` = 'user2' AND `User`.`password` = 'a87e0c9a0bcd15c86f7e319c87955c41cf1dc16f'LIMIT 1 The problem obviously is that there is nothing between 'SELECT' and 'FROM', which leads me to believe that some variable is not getting set. Both the username and the password sections are correct; manually inserting a * allows me to manually run the query successfully. Relevant stuff: login() is an empty function. Auth setup in the controller: function beforeFilter() { $this-Auth-loginAction = array('controller'='users','action'='login'); $this-Auth-allow('register'); $this-Auth-redirectLogin = array('controller'='professor','action'='index'); } Cake debug stuff: DboSource::showQuery() - CORE/cake/libs/model/datasources/ dbo_source.php, line 549 DboSource::execute() - CORE/cake/libs/model/datasources/ dbo_source.php, line 216 DboSource::fetchAll() - CORE/cake/libs/model/datasources/ dbo_source.php, line 354 DboSource::read() - CORE/cake/libs/model/datasources/dbo_source.php, line 680 Model::find() - CORE/cake/libs/model/model.php, line 2067 AuthComponent::identify() - CORE/cake/libs/controller/components/ auth.php, line 857 AuthComponent::login() - CORE/cake/libs/controller/components/ auth.php, line 664 AuthComponent::startup() - CORE/cake/libs/controller/components/ auth.php, line 352 Component::startup() - CORE/cake/libs/controller/component.php, line 121 Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 223 Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 206 [main] - APP/webroot/index.php, line 87 Query: SELECT FROM `users` AS `User` WHERE `User`.`username` = 'user2' AND `User`.`password` = 'a87e0c9a0bcd15c86f7e319c87955c41cf1dc16f'LIMIT 1 As far as I can tell, there is nothing interesting going on in the user model. 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
Login
Hi, I just want to create a login controller in cake.. the url will probably like this http://localhost/cake/login/ if i named the controller like logins http://localhost/cake/logins/ it 'll not sounds good... is there any way of making the standalone controller for login... i don't want it to be like this http://localhost/cakephp/users/login.. 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
Website Structure
Hello, I am a beginner to CakePHP, so forgive my amateur question. I am unsure how to structure my website. I have four blocks and then when one block is clicked it changes to show the content for that block. However the other three blocks still remain visible and clickable so that if you click on another block it will hide the first block and show the new one. Can anyone help me with how I should set up my website in CakePHP? 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
Undefined property: View::$Session
I am getting this error when I am using check function. I have added Session to helper and component in my controller but that doesnt seem to help. 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
Dynamic Fixture List
I'm tired of having to include all of my fixtures when I create a new test case. Is there a method to generate all fixtures needed? I noticed that he 'cake bake test' command can generate a list of fixtures. Is there some way to expose that so when my DB/Model changes I don't have to modify every single test case. --- App::import('Model', 'Server'); class ServerTestCase extends CakeTestCase { //This list is generated by 'cake bake test' var $fixtures = array('app.server', 'app.modem', 'app.keyword'); //Id like somthing like this //var $fixtures = $this-generateFixtures('app.server'); function startTest() { $this-Server = ClassRegistry::init('Server'); } function endTest() { unset($this-Server); ClassRegistry::flush(); } } 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
Multiple login forms submitting to one login action
I'm having 2 login forms in my (cake) application. One on the home page (served by pages controller) and one in my user controller. The one from my user controller is working fine. But when I try to login from the homepage I get a blank page and I see in firebug I got a 404. The strange thing is that the session is setup OK. It's looks like it has something to do with $this-Auth-autoRedirect = false (which is set in user controller beforeFilter()). What could be the problem? 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: Login
I can create a model and define it as Auth userModel on beforeFielter callback of your AppController. function beforeFilter() { $this-Auth-userModel = 'Login'; . . . } and you can define inflections on bootstrap.php for pural of login become login to, and create LoginController as your user authentication controller. On 21 jul, 14:19, Velmurugan Kuberan vkube...@gmail.com wrote: Hi, I just want to create a login controller in cake.. the url will probably like thishttp://localhost/cake/login/if i named the controller like loginshttp://localhost/cake/logins/it 'll not sounds good... is there any way of making the standalone controller for login... i don't want it to be like thishttp://localhost/cakephp/users/login.. 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
Javascript include error
I create a default layout and added css and javascript into it like the following, For CSS I added the following lines in the head section of the default.ctp in layout folder echo $html-css('reset', 'stylesheet', array(media=screen)).\r \n; echo $html-css('style', 'stylesheet', array(media=screen)).\r \n; echo $html-css('invalid', 'stylesheet', array(media=screen)).\r \n\r\n; It worked finely. Then I need to add javascript functionality So I added a line like this after the above code !-- Javascripts -- !-- jQuery -- ?php echo $javascript-link(array('jquery-1.3.2.min')); ? I copy jquery-1.3.2.min to the default webroot/js folder (followed the cakephp convention) But I got a warning message like this: Notice (8): Undefined variable: javascript [APP\views\layouts \default.ctp, line 26] Fatal error: Call to a member function link() on a non-object in D: \xampp\htdocs\cakephp127\app\views\layouts\default.ctp on line 26 I even use $javascript-includeScript() but again I got the same warning I can't able to use the javascript functionality, I am new to cakephp, so I want to know where I am making mistake. 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: Dynamic Fixture List
I've solved the problem for the moment. With this server.test.php App::import('Model', 'Server'); include_once 'PocadsTestCase.php'; class ServerTestCase extends CustomTestCase { function startTest() { $this-Server = ClassRegistry::init('Server'); } function TestFindFirst(){ $this-Server-recursive = 0; $result = $this-Server-find('first'); $this-assertNotNull($result); $expected = array('Server' = array( 'id' = 1, 'name' = 'Lorem ipsum dolor sit amet', 'is_selectable' = 1, 'soap_url' = 'Lorem ipsum dolor sit amet' )); $this-assertEqual($result, $expected); } function endTest() { unset($this-Server); ClassRegistry::flush(); } } CustomTestCase.php - class CustomTestCase extends CakeTestCase { var $fixtures = array('app.server', 'app.modem', 'app.keyword'); } On Jul 21, 12:10 pm, adamcl...@gmail.com adamcl...@gmail.com wrote: I'm tired of having to include all of my fixtures when I create a new test case. Is there a method to generate all fixtures needed? I noticed that he 'cake bake test' command can generate a list of fixtures. Is there some way to expose that so when my DB/Model changes I don't have to modify every single test case. --- App::import('Model', 'Server'); class ServerTestCase extends CakeTestCase { //This list is generated by 'cake bake test' var $fixtures = array('app.server', 'app.modem', 'app.keyword'); //Id like somthing like this //var $fixtures = $this-generateFixtures('app.server'); function startTest() { $this-Server = ClassRegistry::init('Server'); } function endTest() { unset($this-Server); ClassRegistry::flush(); } } 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: $useTable = false - ignored
I have Aro and Aco tables and whole ACL is working just fine. GroupsController operates on both using separate Aco and Aro objects (using aliases as keys). Model is used only for data validation in group edit form - it doesn't need any table. I'm not using it to any read, find or save operations. I could use additional table 'groups' to keep more information about groups there (and I will probably do so) but for now I would only know what causes Cake to check that 'groups' table when I'm telling it that doesn't exist and I don't want to do anything with that. On 21 Lip, 20:35, cricket zijn.digi...@gmail.com wrote: On Wed, Jul 21, 2010 at 9:55 AM, Xander a.ciesiolkiew...@gmail.com wrote: Second model is used to validate the GroupsController edit form. After validation ACL's Aco Tree or both Aro and Aco Trees are updated (users are in both trees, contents in aco only) using separate Aco and Aro objects. I set useTable to false here too, but when using $this-Group- validates() Cake yells Table ncube.groups doesn't exist (...) You cannot associate a model with ARO or ACO if there are no records for it in the DB. You must have a groups table so that groups.id key can be included in aros table. 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
$validate Does not work as expected!
Hi, In the pages controller I've created an action called contact to allow receiving messages from visitors and then this messages are stored in the database. I have a field in the table contacts called mdate which is dedicated for storing the MySQL datetime of the message sent. The mdate has no any fields in the contact forms. The following is contact action code: function contact(){ $this-loadModel('Contact'); if (!empty($this-data)){ $this-Contact-create(); if ($this-Contact-save($this-data)){ $this-Session-setFlash(__('Contact Message has been received.',true)); } else{ $this-Session-setFlash(__('Contact Message Could not be sent!.',true)); } } } In the Contact model I set validate property as following: ?php class Contact extends AppModel{ var $name = 'Contact'; var $validate = array( 'name' = array('notempty'), 'email' = array('notempty','email'), 'message' = array('notempty'), 'mdate' = array('rule' ='notEmpty','message'='no') ); } You may notice at the last line mdate should be validated and it must be not empty. However, the above contact action does not supply any value for mdate and in-spite of this, records are added successfully and mdate field does not have datetime values it is just recorded as 00-00-00 00:00:00 in the database. My question is: Why Contact Model does not apply the validation rules on the mdate field and stop creating the new record? 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: Undefined property: View::$Session
What are you calling and what error are you getting? Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 21 Jul 2010, at 19:01, Abby wrote: I am getting this error when I am using check function. I have added Session to helper and component in my controller but that doesnt seem to help. 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: let users 'edit' database
so a database revision/version control module is not available for cakephp? =( On Jul 20, 10:54 am, mattmoy...@gmail.com mattmoy...@gmail.com wrote: Drupal does something like this called revisions. You could implement a much simpler version of this in your application by adding 2 columns to your database called revision and display. Revision would just be a revision number and you could use a timestamp as the field so it would be unique and also keep track of creation time. The display column would just be a boolean showing which revision to show. Then you would implement some revision control actions in your controller to manage the revisions. This would actually be awesome if generalized and written as a behavior. Unfortunately, I just don't have the time right now. :( On Jul 19, 6:01 pm, Jay jingsi@gmail.com wrote: ok guys, so here is the situation: - we have built up a website using cakephp and it contains several models. - we want some users to be able to make changes to the database via webpage - but we want to audit the changes before they are actual made to the database Our problem is, how do we know what the user changed if those changes are not saved the first time around. We are thinking of displaying a mock database and have the admin merge it with the real db. Is there any other way to tackle this? Thanks for all your inputs. 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: let users 'edit' database
Some guy submitted a multiple undo type thing to the bakery. I thought it was kinda clunky, but it gave me an idea for an improvement, which could also be applied to your situation. Create a table for pending changes, and save all submitted changes to that table in serialized form. Then you can just unserialize and save to the actual db. http://php.net/manual/en/function.serialize.php http://php.net/manual/en/function.serialize.phpThe fields could be something like: id (auto-increment) change_data (serialized array) url (original url change was submitted to, eg - posts/save/24) On Wed, Jul 21, 2010 at 4:43 PM, Jay jingsi@gmail.com wrote: so a database revision/version control module is not available for cakephp? =( On Jul 20, 10:54 am, mattmoy...@gmail.com mattmoy...@gmail.com wrote: Drupal does something like this called revisions. You could implement a much simpler version of this in your application by adding 2 columns to your database called revision and display. Revision would just be a revision number and you could use a timestamp as the field so it would be unique and also keep track of creation time. The display column would just be a boolean showing which revision to show. Then you would implement some revision control actions in your controller to manage the revisions. This would actually be awesome if generalized and written as a behavior. Unfortunately, I just don't have the time right now. :( On Jul 19, 6:01 pm, Jay jingsi@gmail.com wrote: ok guys, so here is the situation: - we have built up a website using cakephp and it contains several models. - we want some users to be able to make changes to the database via webpage - but we want to audit the changes before they are actual made to the database Our problem is, how do we know what the user changed if those changes are not saved the first time around. We are thinking of displaying a mock database and have the admin merge it with the real db. Is there any other way to tackle this? Thanks for all your inputs. 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
How could controller inform about layout or view existing?
Hi, I use themes in my application, so there is multiple layouts and views for each controller could be handled. For one of the themes used, I created a layout called flash which is dedicated for displaying flash messages, so in the controller I used the following line of code: $this-Session-setFlash('The message to user','flsah'); However, In another theme I don't need to format the flash message using the flash layout regarded before, so I don't create flash.ctp in the layout folder of that theme. Of course, when using the other theme, an error is returned tells about missing layout. My qestion is: How could I set some logic in the controller which is able to check if the flash layout is existing in the theme used or not and then assign its value - or name - in a variable to be passed in setFlash method as follows: $flasLayoutName = null; /* pseudo code start */ if there is layout called flash in the current theme /* end pseudo code */ $flashLayoutName = 'flash'; 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: Inflections + Naming Conventions Generator?
sounds like a nice idea that shouldn't be too hard to accomplish maybe you want to give it a try and publish it somewhere i always wanted to set up a sandbox cakeapp with some similar stuff never had the time though for such little goodies so if you lack the webspace i could offer you the url sandbox.dereuromark.de for your sandbox just write me an email advantage for you: after doing so, you pretty much know everything there is to know about those conventions and stuff and from someone new to cake like you if might cover some interesting points of view that we wouldn't think of maybe. we will probably find other tools we could develope as well On 21 Jul., 14:29, Anthony anthony.c.fra...@gmail.com wrote: Does anyone know of a site that would allow you to enter a word or two (something you'd use for a table name) and then spits out a list of the inflections and where each one should be used (ie: the corresponding file name, URL, object name, etc) following cake naming conventions? Or if you enter two give you the habtm key field names and joining table name? I can see something like this being really useful for new cake users like myself. Not that I haven't picked it up fairly easy but there are still places where I simply guess which inflection to use then change it when things don't work. The conventions page does a good job of explaining but interactive = better ;) 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
Trouble on non-standard database tables
database tables CREATE TABLE IF NOT EXISTS `product` ( `id_product` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_supplier` int(10) unsigned DEFAULT NULL, `id_manufacturer` int(10) unsigned DEFAULT NULL, `id_tax` int(10) unsigned NOT NULL, `id_category_default` int(10) unsigned DEFAULT NULL, `id_color_default` int(10) unsigned DEFAULT NULL, `on_sale` tinyint(1) unsigned NOT NULL DEFAULT '0', `ean13` varchar(13) DEFAULT NULL, `ecotax` decimal(17,2) NOT NULL DEFAULT '0.00', `quantity` int(10) unsigned NOT NULL DEFAULT '0', `price` decimal(20,6) NOT NULL DEFAULT '0.00', `wholesale_price` decimal(20,6) NOT NULL DEFAULT '0.00', `reduction_price` decimal(17,2) DEFAULT NULL, `reduction_percent` float DEFAULT NULL, `reduction_from` datetime NOT NULL DEFAULT '1970-01-01 00:00:00', `reduction_to` datetime NOT NULL DEFAULT '1970-01-01 00:00:00', `reference` varchar(32) DEFAULT NULL, `supplier_reference` varchar(32) DEFAULT NULL, `location` varchar(64) DEFAULT NULL, `weight` float NOT NULL DEFAULT '0', `out_of_stock` int(10) unsigned NOT NULL DEFAULT '2', `quantity_discount` tinyint(1) DEFAULT '0', `customizable` tinyint(2) NOT NULL DEFAULT '0', `uploadable_files` tinyint(4) NOT NULL DEFAULT '0', `text_fields` tinyint(4) NOT NULL DEFAULT '0', `active` tinyint(1) unsigned NOT NULL DEFAULT '0', `indexed` tinyint(1) NOT NULL DEFAULT '0', `date_add` datetime NOT NULL, `date_upd` datetime NOT NULL, PRIMARY KEY (`id_product`), KEY `product_supplier` (`id_supplier`), KEY `product_manufacturer` (`id_manufacturer`), KEY `id_tax` (`id_tax`), KEY `id_category_default` (`id_category_default`), KEY `id_color_default` (`id_color_default`), KEY `date_add` (`date_add`) ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `supplier` ( `id_supplier` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(64) NOT NULL, `date_add` datetime NOT NULL, `date_upd` datetime NOT NULL, PRIMARY KEY (`id_supplier`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; supplier.php ?php class Supplier extends AppModel { var $name = 'Supplier'; var $useTable = 'supplier'; var $primaryKey = 'id_supplier'; var $hasMany = array('Product' = array( 'className' = 'Product', 'foreignKey' = 'id_supplier', 'dependent' = true,) ); } ? product.php ?php class Product extends AppModel { var $name = 'Product'; var $useTable = 'product'; var $primaryKey = 'id_product'; var $belongsTo = array( 'Supplier' = array( 'className' = 'Supplier', 'foreignKey' = 'id_supplier', 'conditions' = '', 'fields' = '', 'order' = '')); } ? products_controller.php (just showing add method) (...) function add() { if (!empty($this-data)) { $this-Product-create(); if ($this-Product-save($this-data)) { $this-Session-setFlash(__('The product has been saved', true)); $this-redirect(array('action' = 'index')); } else { $this-Session-setFlash(__('The product could not be saved. Please, try again.', true)); } } $suppliers = $this-Product-Supplier-find('list'); $this-set(compact('suppliers')); } (...) add.ctp div class=products form ?php echo $this-Form-create('Product');? fieldset legend?php __('Add Product'); ?/legend ?php echo $this-Form-input('id_product'); echo $this-Form-input('id_supplier'); (...) Why it doesn't show Product form with Suppliers as combobox? 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
Access in controller data modified in a Model on callback method beforeSave?
Is is possible to access data modified in a Model on callback method beforeSave? I changed the value of a variable on beforeSave method in a model and I need to retrieve that new value on my controller. I know i can use the read method to get that value, but I was hoping if it's possible to do that without any new requests to the database. 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 Does not work as expected!
I guess you should use cake convention flelds for this which are 'created' and 'modified' instead of 'mdate' in your case. If you have those fields in your table you won't have to bother about validating or saving manually that datetime of your records. On 21 jul, 17:37, saidbakr said@gmail.com wrote: Hi, In the pages controller I've created an action called contact to allow receiving messages from visitors and then this messages are stored in the database. I have a field in the table contacts called mdate which is dedicated for storing the MySQL datetime of the message sent. The mdate has no any fields in the contact forms. The following is contact action code: function contact(){ $this-loadModel('Contact'); if (!empty($this-data)){ $this-Contact-create(); if ($this-Contact-save($this-data)){ $this-Session-setFlash(__('Contact Message has been received.',true)); } else{ $this-Session-setFlash(__('Contact Message Could not be sent!.',true)); } } } In the Contact model I set validate property as following: ?php class Contact extends AppModel{ var $name = 'Contact'; var $validate = array( 'name' = array('notempty'), 'email' = array('notempty','email'), 'message' = array('notempty'), 'mdate' = array('rule' ='notEmpty','message'='no') ); } You may notice at the last line mdate should be validated and it must be not empty. However, the above contact action does not supply any value for mdate and in-spite of this, records are added successfully and mdate field does not have datetime values it is just recorded as 00-00-00 00:00:00 in the database. My question is: Why Contact Model does not apply the validation rules on the mdate field and stop creating the new record? 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 could controller inform about layout or view existing?
Just create flsah for every theme and keep default markup for those you do not need special. On Jul 22, 5:19 am, saidbakr said@gmail.com wrote: Hi, I use themes in my application, so there is multiple layouts and views for each controller could be handled. For one of the themes used, I created a layout called flash which is dedicated for displaying flash messages, so in the controller I used the following line of code: $this-Session-setFlash('The message to user','flsah'); However, In another theme I don't need to format the flash message using the flash layout regarded before, so I don't create flash.ctp in the layout folder of that theme. Of course, when using the other theme, an error is returned tells about missing layout. My qestion is: How could I set some logic in the controller which is able to check if the flash layout is existing in the theme used or not and then assign its value - or name - in a variable to be passed in setFlash method as follows: $flasLayoutName = null; /* pseudo code start */ if there is layout called flash in the current theme /* end pseudo code */ $flashLayoutName = 'flash'; 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