Changing table field using 2 different models
I have an IT query system were by users can add their queries, when they add their query the IT department then replies/comments on the query. How is should work is when the user adds a query it must change the query_type field in the it_queries table to OPEN and when the IT department views the query they reply/comment on it and must change query_type field from OPEN to PENDING then finally when the user has been helped/assisted they should be able to mark the query as closed using a checkbox, that will then change the status from PENDING TO CLOSE. Not sure if they is a way of setting the constants in the add views and insert in the table. Obviously i am learning and can someone please guide me on the steps i must take. Here is my code for the add it_query for the users ?php echo $this-Form-create('ItQuery'); ? fieldset legend?php echo __('Add It Query'); ?/legend ?php echo $this-Form-hidden('hr_employee_id',array('value'=$loggedInId)); echo $this-Form-input('it_query_type_id'); echo $this-Form-input('comment'); echo $this-Form-input('it_status_query_id'); ? /fieldset ?php echo $this-Form-end(__('Submit')); ? Here is the code for my comments for IT Department div class=comment form h2?php echo __('Add a comment'); ?/h2 ?php echo $this-Form-create ( 'Feedback.Comment', array ( 'url' = array ( 'plugin' = 'feedback', 'controller' = 'comments', 'action' = 'add', $foreign_model, $foreign_id ) ) ); ? ?php echo $this-Form-input('Comment.author_name', array('label' = __('Name'))); ? ?php echo $this-Form-input('Comment.hairy_pot', array('type' = 'hidden')); ? ?php echo $this-Form-input('Comment.content', array('label' = __('Comments'))); ? ?php echo $this-Form-input('Comment.foreign_model', array('type' = 'hidden', 'value' = $foreign_model)); ? ?php echo $this-Form-input('Comment.foreign_id', array('type' = 'hidden', 'value' = $foreign_id)); ? ?php echo $this-Form-end(__('Save comment')); ? /div -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
How to define a variable in Cakephp
I trying to pass a variable in cakephp to a view and getting error Undefined variable: view [APP\View\ItQueries\add.ctp, line 9] and line 9 is this ?php echo $this-Form-hidden('status_type', array('value'=$view)); ? Here is how im defining my variable in the controller class ItQueriesController extends AppController { var $view = 'Open'; public function index() { $this-ItQuery-recursive = 0; $this-set('view', $this-view); } //Other Code } and here is where im trying to pass the variable as a hidden field ?php echo $this-Form-create('ItQuery'); ? ?php echo __('Add It Query'); ?/legend ?php echo $this-Form-input('status_type', array('type' = 'hidden', 'value'=$view)); ? ?php echo $this-Form-end(__('Submit')); ? Can some please show me how to fix this -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: How to define a variable in Cakephp
http://stackoverflow.com/questions/15221467/how-to-define-a-variable-in-cakephp Am Dienstag, 5. März 2013 11:55:37 UTC+1 schrieb Victor Musvibe: I trying to pass a variable in cakephp to a view and getting error Undefined variable: view [APP\View\ItQueries\add.ctp, line 9] and line 9 is this ?php echo $this-Form-hidden('status_type', array('value'=$view)); ? Here is how im defining my variable in the controller class ItQueriesController extends AppController { var $view = 'Open'; public function index() { $this-ItQuery-recursive = 0; $this-set('view', $this-view); } //Other Code } and here is where im trying to pass the variable as a hidden field ?php echo $this-Form-create('ItQuery'); ? ?php echo __('Add It Query'); ?/legend ?php echo $this-Form-input('status_type', array('type' = 'hidden', 'value'=$view)); ? ?php echo $this-Form-end(__('Submit')); ? Can some please show me how to fix this -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: How to define a variable in Cakephp
Some light reading for you: http://book.cakephp.org/2.0/en/index.html http://book.cakephp.org/2.0/en/tutorials-and-examples.html Jeremy Burns Class Outfit http://www.classoutfit.com On 5 Mar 2013, at 10:55:37, Victor Musvibe jaahvi...@gmail.com wrote: I trying to pass a variable in cakephp to a view and getting error Undefined variable: view [APP\View\ItQueries\add.ctp, line 9] and line 9 is this ?php echo $this-Form-hidden('status_type', array('value'=$view)); ? Here is how im defining my variable in the controller class ItQueriesController extends AppController { var $view = 'Open'; public function index() { $this-ItQuery-recursive = 0; $this-set('view', $this-view); } //Other Code } and here is where im trying to pass the variable as a hidden field ?php echo $this-Form-create('ItQuery'); ? ?php echo __('Add It Query'); ?/legend ?php echo $this-Form-input('status_type', array('type' = 'hidden', 'value'=$view)); ? ?php echo $this-Form-end(__('Submit')); ? Can some please show me how to fix this -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: How to define a variable in Cakephp
Hi Euromark I am the one who posted that. Was hoping to get a quicker response on the cakephp group On Tue, Mar 5, 2013 at 12:57 PM, euromark dereurom...@gmail.com wrote: http://stackoverflow.com/questions/15221467/how-to-define-a-variable-in-cakephp Am Dienstag, 5. März 2013 11:55:37 UTC+1 schrieb Victor Musvibe: I trying to pass a variable in cakephp to a view and getting error Undefined variable: view [APP\View\ItQueries\add.ctp, line 9] and line 9 is this ?php echo $this-Form-hidden('status_**type', array('value'=$view)); ? Here is how im defining my variable in the controller class ItQueriesController extends AppController { var $view = 'Open'; public function index() { $this-ItQuery-recursive = 0; $this-set('view', $this-view); } //Other Code } and here is where im trying to pass the variable as a hidden field ?php echo $this-Form-create('ItQuery')**; ? ?php echo __('Add It Query'); ?/legend ?php echo $this-Form-input('status_**type', array('type' = 'hidden', 'value'=$view)); ? ?php echo $this-Form-end(__('Submit'))**; ? Can some please show me how to fix this -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to a topic in the Google Groups CakePHP group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/cake-php/T5fDJXZAHwY/unsubscribe?hl=en. To unsubscribe from this group and all its topics, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: How to define a variable in Cakephp
To pass a variable through to a view, simply do this in your controller function: $this-set('myVariableName', $variableValue); Then in your view you can refer to $variableValue. Jeremy Burns Class Outfit http://www.classoutfit.com On 5 Mar 2013, at 10:59:50, Victor Musvibe jaahvi...@gmail.com wrote: Hi Euromark I am the one who posted that. Was hoping to get a quicker response on the cakephp group On Tue, Mar 5, 2013 at 12:57 PM, euromark dereurom...@gmail.com wrote: http://stackoverflow.com/questions/15221467/how-to-define-a-variable-in-cakephp Am Dienstag, 5. März 2013 11:55:37 UTC+1 schrieb Victor Musvibe: I trying to pass a variable in cakephp to a view and getting error Undefined variable: view [APP\View\ItQueries\add.ctp, line 9] and line 9 is this ?php echo $this-Form-hidden('status_type', array('value'=$view)); ? Here is how im defining my variable in the controller class ItQueriesController extends AppController { var $view = 'Open'; public function index() { $this-ItQuery-recursive = 0; $this-set('view', $this-view); } //Other Code } and here is where im trying to pass the variable as a hidden field ?php echo $this-Form-create('ItQuery'); ? ?php echo __('Add It Query'); ?/legend ?php echo $this-Form-input('status_type', array('type' = 'hidden', 'value'=$view)); ? ?php echo $this-Form-end(__('Submit')); ? Can some please show me how to fix this -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to a topic in the Google Groups CakePHP group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/cake-php/T5fDJXZAHwY/unsubscribe?hl=en. To unsubscribe from this group and all its topics, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: How to define a variable in Cakephp
Instead of *var $view = 'Open';* Write this *public $view = 'Open';* -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: How to define a variable in Cakephp
Correction (sorry): Then in your view you can refer to $myVariableName. Jeremy Burns Class Outfit http://www.classoutfit.com On 5 Mar 2013, at 11:03:15, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: To pass a variable through to a view, simply do this in your controller function: $this-set('myVariableName', $variableValue); Then in your view you can refer to $variableValue. Jeremy Burns Class Outfit http://www.classoutfit.com On 5 Mar 2013, at 10:59:50, Victor Musvibe jaahvi...@gmail.com wrote: Hi Euromark I am the one who posted that. Was hoping to get a quicker response on the cakephp group On Tue, Mar 5, 2013 at 12:57 PM, euromark dereurom...@gmail.com wrote: http://stackoverflow.com/questions/15221467/how-to-define-a-variable-in-cakephp Am Dienstag, 5. März 2013 11:55:37 UTC+1 schrieb Victor Musvibe: I trying to pass a variable in cakephp to a view and getting error Undefined variable: view [APP\View\ItQueries\add.ctp, line 9] and line 9 is this ?php echo $this-Form-hidden('status_type', array('value'=$view)); ? Here is how im defining my variable in the controller class ItQueriesController extends AppController { var $view = 'Open'; public function index() { $this-ItQuery-recursive = 0; $this-set('view', $this-view); } //Other Code } and here is where im trying to pass the variable as a hidden field ?php echo $this-Form-create('ItQuery'); ? ?php echo __('Add It Query'); ?/legend ?php echo $this-Form-input('status_type', array('type' = 'hidden', 'value'=$view)); ? ?php echo $this-Form-end(__('Submit')); ? Can some please show me how to fix this -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to a topic in the Google Groups CakePHP group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/cake-php/T5fDJXZAHwY/unsubscribe?hl=en. To unsubscribe from this group and all its topics, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: How to define a variable in Cakephp
Thank you, now it works. What i did was in my controller i put this line public $variableValue = 'Open'; Then in my add function $this-set('variableValue', $this-variableValue); And lastly in my add view echo $this-Form-input('status_type', array('type' = 'hidden', 'value'=$variableValue)); Hope this will help out someone with the same challenge On Tue, Mar 5, 2013 at 1:08 PM, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: Correction (sorry): Then in your view you can refer to *$myVariableName*. Jeremy Burns Class Outfit http://www.classoutfit.com On 5 Mar 2013, at 11:03:15, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: To pass a variable through to a view, simply do this in your controller function: $this-set('myVariableName', $variableValue); Then in your view you can refer to $variableValue. Jeremy Burns Class Outfit http://www.classoutfit.com On 5 Mar 2013, at 10:59:50, Victor Musvibe jaahvi...@gmail.com wrote: Hi Euromark I am the one who posted that. Was hoping to get a quicker response on the cakephp group On Tue, Mar 5, 2013 at 12:57 PM, euromark dereurom...@gmail.com wrote: http://stackoverflow.com/questions/15221467/how-to-define-a-variable-in-cakephp Am Dienstag, 5. März 2013 11:55:37 UTC+1 schrieb Victor Musvibe: I trying to pass a variable in cakephp to a view and getting error Undefined variable: view [APP\View\ItQueries\add.ctp, line 9] and line 9 is this ?php echo $this-Form-hidden('status_**type', array('value'=$view)); ? Here is how im defining my variable in the controller class ItQueriesController extends AppController { var $view = 'Open'; public function index() { $this-ItQuery-recursive = 0; $this-set('view', $this-view); } //Other Code } and here is where im trying to pass the variable as a hidden field ?php echo $this-Form-create('ItQuery')**; ? ?php echo __('Add It Query'); ?/legend ?php echo $this-Form-input('status_**type', array('type' = 'hidden', 'value'=$view)); ? ?php echo $this-Form-end(__('Submit'))**; ? Can some please show me how to fix this -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to a topic in the Google Groups CakePHP group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/cake-php/T5fDJXZAHwY/unsubscribe?hl=en. To unsubscribe from this group and all its topics, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to a topic in the Google Groups CakePHP group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/cake-php/T5fDJXZAHwY/unsubscribe?hl=en. To unsubscribe from this group and all its topics, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more
Re: How to define a variable in Cakephp
I'm pleased it works, but I'm confused why you need this line: public $variableValue = 'Open'; Why not just do this: $this-set('variableValue', 'Open'); Jeremy Burns Class Outfit http://www.classoutfit.com On 5 Mar 2013, at 12:08:43, Victor Musvibe jaahvi...@gmail.com wrote: Thank you, now it works. What i did was in my controller i put this line public $variableValue = 'Open'; Then in my add function $this-set('variableValue', $this-variableValue); And lastly in my add view echo $this-Form-input('status_type', array('type' = 'hidden', 'value'=$variableValue)); Hope this will help out someone with the same challenge On Tue, Mar 5, 2013 at 1:08 PM, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: Correction (sorry): Then in your view you can refer to $myVariableName. Jeremy Burns Class Outfit http://www.classoutfit.com On 5 Mar 2013, at 11:03:15, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: To pass a variable through to a view, simply do this in your controller function: $this-set('myVariableName', $variableValue); Then in your view you can refer to $variableValue. Jeremy Burns Class Outfit http://www.classoutfit.com On 5 Mar 2013, at 10:59:50, Victor Musvibe jaahvi...@gmail.com wrote: Hi Euromark I am the one who posted that. Was hoping to get a quicker response on the cakephp group On Tue, Mar 5, 2013 at 12:57 PM, euromark dereurom...@gmail.com wrote: http://stackoverflow.com/questions/15221467/how-to-define-a-variable-in-cakephp Am Dienstag, 5. März 2013 11:55:37 UTC+1 schrieb Victor Musvibe: I trying to pass a variable in cakephp to a view and getting error Undefined variable: view [APP\View\ItQueries\add.ctp, line 9] and line 9 is this ?php echo $this-Form-hidden('status_type', array('value'=$view)); ? Here is how im defining my variable in the controller class ItQueriesController extends AppController { var $view = 'Open'; public function index() { $this-ItQuery-recursive = 0; $this-set('view', $this-view); } //Other Code } and here is where im trying to pass the variable as a hidden field ?php echo $this-Form-create('ItQuery'); ? ?php echo __('Add It Query'); ?/legend ?php echo $this-Form-input('status_type', array('type' = 'hidden', 'value'=$view)); ? ?php echo $this-Form-end(__('Submit')); ? Can some please show me how to fix this -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to a topic in the Google Groups CakePHP group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/cake-php/T5fDJXZAHwY/unsubscribe?hl=en. To unsubscribe from this group and all its topics, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to a topic in the Google Groups CakePHP group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/cake-php/T5fDJXZAHwY/unsubscribe?hl=en. To unsubscribe from this group and all its topics, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter
Re: How to define a variable in Cakephp
Yes you right. I have removed public $variableValue = 'Open'; and did exactly what you did On Tue, Mar 5, 2013 at 2:12 PM, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: I'm pleased it works, but I'm confused why you need this line: public $variableValue = 'Open'; Why not just do this: $this-set('variableValue', 'Open'); Jeremy Burns Class Outfit http://www.classoutfit.com On 5 Mar 2013, at 12:08:43, Victor Musvibe jaahvi...@gmail.com wrote: Thank you, now it works. What i did was in my controller i put this line public $variableValue = 'Open'; Then in my add function $this-set('variableValue', $this-variableValue); And lastly in my add view echo $this-Form-input('status_type', array('type' = 'hidden', 'value'=$variableValue)); Hope this will help out someone with the same challenge On Tue, Mar 5, 2013 at 1:08 PM, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: Correction (sorry): Then in your view you can refer to *$myVariableName*. Jeremy Burns Class Outfit http://www.classoutfit.com On 5 Mar 2013, at 11:03:15, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: To pass a variable through to a view, simply do this in your controller function: $this-set('myVariableName', $variableValue); Then in your view you can refer to $variableValue. Jeremy Burns Class Outfit http://www.classoutfit.com On 5 Mar 2013, at 10:59:50, Victor Musvibe jaahvi...@gmail.com wrote: Hi Euromark I am the one who posted that. Was hoping to get a quicker response on the cakephp group On Tue, Mar 5, 2013 at 12:57 PM, euromark dereurom...@gmail.com wrote: http://stackoverflow.com/questions/15221467/how-to-define-a-variable-in-cakephp Am Dienstag, 5. März 2013 11:55:37 UTC+1 schrieb Victor Musvibe: I trying to pass a variable in cakephp to a view and getting error Undefined variable: view [APP\View\ItQueries\add.ctp, line 9] and line 9 is this ?php echo $this-Form-hidden('status_**type', array('value'=$view)); ? Here is how im defining my variable in the controller class ItQueriesController extends AppController { var $view = 'Open'; public function index() { $this-ItQuery-recursive = 0; $this-set('view', $this-view); } //Other Code } and here is where im trying to pass the variable as a hidden field ?php echo $this-Form-create('ItQuery')**; ? ?php echo __('Add It Query'); ?/legend ?php echo $this-Form-input('status_**type', array('type' = 'hidden', 'value'=$view)); ? ?php echo $this-Form-end(__('Submit'))**; ? Can some please show me how to fix this -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to a topic in the Google Groups CakePHP group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/cake-php/T5fDJXZAHwY/unsubscribe?hl=en . To unsubscribe from this group and all its topics, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to a topic in the Google Groups CakePHP group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/cake-php/T5fDJXZAHwY/unsubscribe?hl=en. To unsubscribe from this group and all its topics, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit
How to insert a checkbox value into a table from plugin in Cakephp
I am using a feedback plugin for my app and on the add view i am putting a checkbox with value Pending. I was wondering if they is a away that when the checkbox is ticket it will insert the checkbox value into a table named it_queries and field name status_type. Here is how i am declaring my variable name in the plugin controller $this-set('variableValueStatus', 'Pending'); and here is the Plugin controller code ?php App::uses('FeedbackAppController', 'Feedback.Controller'); class CommentsController extends FeedbackAppController { public $components = array('Feedback.Comments'); public function add($foreign_model = null, $foreign_id = null) { $this-set('variableValueStatus', 'Pending'); if (empty($foreign_model) || empty($foreign_id) || !$this-request-is('post') ) { return $this-redirect('/'); } App::uses($foreign_model, 'Model'); $Model = ClassRegistry::init($foreign_model); if (!($Model instanceof Model)) { return $this-redirect('/'); } if ($Model-hasAny(array($Model-primaryKey = $foreign_id)) == false) { return $this-redirect('/'); } if (!isset($this-request-data['Comment']['foreign_model']) || !isset($this-request-data['Comment']['foreign_id']) || $this-request-data['Comment']['foreign_model'] != $foreign_model || $this-request-data['Comment']['foreign_id'] != $foreign_id) { return $this-redirect('/'); } $user_id = null; if (isset($this-Auth)) { $user_id = $this-Auth-user('id'); } $this-request-data['Comment']['foreign_model'] = $Model-name; $this-request-data['Comment']['foreign_id'] = $foreign_id; $this-request-data['Comment']['user_id'] = $user_id; $this-request-data['Comment']['author_ip'] = $this-request-clientIp(); $this-Comment-create(); if (!$this-Comment-save($this-request-data)) { $this-set('validation_errors', $this-Comment-validationErrors); return; } $this-redirect($this-request-referer().'#comment-'.$this-Comment-id); } } and here is my code for the checkbox in the plugin add view ?php echo $this-Form-checkbox('ItQuery.status_type', array('type' = 'hidden', 'value'=$variableValueStatus)); ? Can some please show me how to fix this -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Getting conditions Data for View
Hi there, i have a view which reads all data from database (find'list') now i would like to get only the data with the event_id '2 so i have created a own view 'sorted' in the controller i use following public function sorted() { if ($this-Session-read('Event.active') == NULL) { $this-redirect(array('action' = 'index')); } else { $jobs = $this-Job-find('list', array('conditions' = array('Job.event_id' = '2'))); $this-set('jobs', $this-paginate()); } } But the problem, i always get all data. any ideal how i can read out only the data with the Job.event_id = 2 values ?? Thx for help -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Getting conditions Data for View
You are doing two finds and it is the last one (paginate) that is being returned to the view. Comment that out and see what happens. You also didn't ought to hard code the value 2; you ought to pass it in as a variable, something like this: public function sorted($eventId = null) { if ($this-Session-read('Event.active') == NULL) { $this-redirect(array('action' = 'index')); } else { if ($eventId) { $jobs = $this-Job-find( 'list', array( 'conditions' = array('Job.event_id' = $eventId) ) ); } else { $jobs = $this-Job-find('list'); } $this-set('jobs', $jobs); } } Jeremy Burns Class Outfit http://www.classoutfit.com On 5 Mar 2013, at 17:06:15, Jerome Walitzek jerome.walit...@t-online.de wrote: Hi there, i have a view which reads all data from database (find'list') now i would like to get only the data with the event_id '2 so i have created a own view 'sorted' in the controller i use following public function sorted() { if ($this-Session-read('Event.active') == NULL) { $this-redirect(array('action' = 'index')); } else { $jobs = $this-Job-find('list', array('conditions' = array('Job.event_id' = '2'))); $this-set('jobs', $this-paginate()); } } But the problem, i always get all data. any ideal how i can read out only the data with the Job.event_id = 2 values ?? Thx for help -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Getting conditions Data for View
Hi Jeremy, thanks for your answer. I hard coded 2 into the controller to check what happens. i think it is important to notice following. in an other view i write the event_id into a session $this-Session-write('Event.active', $id); that works and when i read it out in an model it works also. what I want: I click in my event view on a button called activate at the relevant data set on. This click writes the respective event_id in the session event.active. Now I jump into the joblist and will get only the datasets with the event_id which is located in the session read. Why I want to solve this with a SESSION is a little too complicated to explain it now :-) do you understand what i meen ? :-) Am Dienstag, 5. März 2013 18:12:20 UTC+1 schrieb Jeremy Burns: You are doing two finds and it is the last one (paginate) that is being returned to the view. Comment that out and see what happens. You also didn't ought to hard code the value 2; you ought to pass it in as a variable, something like this: public function sorted($eventId = null) { if ($this-Session-read('Event.active') == NULL) { $this-redirect(array('action' = 'index')); } else { if ($eventId) { $jobs = $this-Job-find( 'list', array( 'conditions' = array('Job.event_id' = $eventId) ) ); } else { $jobs = $this-Job-find('list'); } $this-set('jobs', $jobs); } } Jeremy Burns Class Outfit http://www.classoutfit.com On 5 Mar 2013, at 17:06:15, Jerome Walitzek jerome@t-online.dejavascript: wrote: Hi there, i have a view which reads all data from database (find'list') now i would like to get only the data with the event_id '2 so i have created a own view 'sorted' in the controller i use following public function sorted() { if ($this-Session-read('Event.active') == NULL) { $this-redirect(array('action' = 'index')); } else { $jobs = $this-Job-find('list', array('conditions' = array('Job.event_id' = '2'))); $this-set('jobs', $this-paginate()); } } But the problem, i always get all data. any ideal how i can read out only the data with the Job.event_id = 2 values ?? Thx for help -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+u...@googlegroups.com javascript:. To post to this group, send email to cake...@googlegroups.comjavascript: . Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: reset form input after submission with jQuery and unique ID
anyone...? On Tuesday, February 26, 2013 8:45:43 PM UTC-8, Chris wrote: hi guys,... can anyone help please,... how can I reset form after submission with unique ID, with jquery? Where unique ID is $photo_comment['PhotoComment']['id'] this is what I have so far,... and how do I code $photo_comment['PhotoComment']['id'] when complete: , 'complete' = 'javascript:resetReportPhotoCommentForm();' p ?php echo $ajax-submit('Report', array('url'= array('controller'='photo_comments', 'action'='report_spam/'. $photo_comment['PhotoComment']['id']), 'update' = updateReportPhotoComment_.$photo_comment['PhotoComment']['id'], 'complete' = 'javascript:resetReportPhotoCommentForm();')); ? ?php echo $form-end(); ? /p script function resetReportPhotoCommentForm() { document.getElementById(ReportCommentFormId).reset(); } /script thanks in advance chris -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: reset form after submission
anyone,...? On Sunday, March 3, 2013 2:32:57 PM UTC-8, Chris wrote: hi guys,... can anyone help please,... I'm using jQuery,... how can I reset form after submission with unique ID, this is what I have so far,... but it reset ONLY for last comment report. this form is for photo comment report,... and if I have lets say 9 comments, it only reset the last one 9 but not 1, or 2,... or 8 ?php echo $this-Form-create('PhotoComment', array('id'=ReportComments_.$photo_comment['PhotoComment']['id'])); ? ?php echo $form-hidden('Report.sender_id', array('value' = $user_object['id'])) ? p style=font-size: 1.2em; font-weight: normal; ?php echo $this-Form-textarea('Report.content'); ? /p div class=clr/div p ?php echo $ajax-submit('Report', array('url'= array('controller'='photo_comments', 'action'='report_spam/'. $photo_comment['PhotoComment']['id']), 'update' = updateReportPhotoComment_.$photo_comment['PhotoComment']['id'], 'complete' = 'javascript:resetReportPhotoCommentForm();')); ? ?php echo $form-end(); ? /p div class=clr/div script function resetReportPhotoCommentForm() { document.getElementById(ReportComments_?php echo $photo_comment['PhotoComment']['id'] ?).reset(); } /script thanks in advance chris -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: reset form input after submission with jQuery and unique ID
I have moved topic to new post,... can anyone help please,... https://groups.google.com/forum/?fromgroups=#!topic/cake-php/amKeMnVR_dI On Tuesday, February 26, 2013 8:45:43 PM UTC-8, Chris wrote: hi guys,... can anyone help please,... how can I reset form after submission with unique ID, with jquery? Where unique ID is $photo_comment['PhotoComment']['id'] this is what I have so far,... and how do I code $photo_comment['PhotoComment']['id'] when complete: , 'complete' = 'javascript:resetReportPhotoCommentForm();' p ?php echo $ajax-submit('Report', array('url'= array('controller'='photo_comments', 'action'='report_spam/'. $photo_comment['PhotoComment']['id']), 'update' = updateReportPhotoComment_.$photo_comment['PhotoComment']['id'], 'complete' = 'javascript:resetReportPhotoCommentForm();')); ? ?php echo $form-end(); ? /p script function resetReportPhotoCommentForm() { document.getElementById(ReportCommentFormId).reset(); } /script thanks in advance chris -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: cakephp 1.3 how to send email
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Joseph, I post an example I have in a 1.3 app working: In a controller I want to receive an email in a certain case: if($this-data['Rating']['kommentar'] != ''){ // notification that a comment was posted $this-Email-from= 'Zigarrenlounge adre...@zigarrenlounge.eu'; $this-Email-to = 'Zigarrenlounge adre...@zigarrenlounge.eu'; $this-Email-subject = 'My wonderful email subject'; $this-Email-send('And here come sthe text of the email I want to send.'); } In my AppController.php I have: var $components = array('Session','Auth','MathCaptcha','Email'); So I have activated the email component. That should be the magic of course on your webserver you need any email activated, but the avarge hoste has that by default. Calamity Jane P.S. I hope I could help for once :) Am 04.03.2013 19:32, schrieb Joseph zhu: Hello there: I am a new for cakephp, I want to know how to make send email function. Who can help me, and give me some detail instructions. Thank you so much. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAlE2TpsACgkQbOdiIJzHNKFdJQCgrp4G6MyyZeShNpWVzcFl9MkW cxcAnRUZIX3pm4Il15qiQj3xyZqq5+37 =aDt2 -END PGP SIGNATURE- -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Fuel UX in cake
Hello i want to integrate Fuel UX (http://exacttarget.github.com/fuelux/) to my cake project... anybody has try that?? Thanks! -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Setting the Value of Options in a drop down...
Hello! Here is what I have in my view: if($biddetail['Biddetail']['Sold'] == 'SOLD'){$otherstate = 'OPEN';} else {$otherstate = 'SOLD';} echo $this-Form-input('Sold', array('options' = array($otherstate),'empty' = $biddetail['Biddetail']['Sold'])); Is there no way to set the value to equal to the option? ie value = 'SOLD' rather than value = '0'. As you can see above the values change based on the current value populated in the data base... I don't want to have to go back and add a table to hold two values that will never change. Any solutions? I have already read the documentation at: http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html which does not provide a solution for this question. Thanks!! -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Pattern Matching for Security-unlockedFields
I have not tested this. ymmv function beforeFilter() { parent::beforeFilter(); // second test is optional if ($this-request-is('post') $this-action == 'whatever') { // only want the keys here $dynamic_fields = array_keys(preg_grep('/^Cat[0-9]+name$/', $this-request-data['YourModel'])); // array_merge will leave duplicates for arrays with numeric indices $this-Security-unlockedFields = array_unique( array_merge( $this-Security-unlockedFields, $dynamic_fields ) ); } } On Mon, Mar 4, 2013 at 7:48 PM, #2Will willjbar...@gmail.com wrote: I'm dynamicly adding fields for hasMany relation in my form, with JS. Thats obviously messing with the Security components form tampering detection - and blackholing the request U can get it to not blackhole by doing this in the beforeFilter: $this-Security-unlockedFields = array( 'Cat0name'); I guess i could add Cat1name, Cat2name, cat3name etc etc to the array. But it makes me feel sad. Is there a better way? Can I get it to pattern match somehow? Iv'e got in my head ideas like regex - is that at all possible? I must admit, i read the code for the _validatePost function that uses the unlockedFields setting, and I didn't really fully understand it. Thanks for any pointers Will -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Authentication issue
If AuthController is included in AppController's $components array, it will be enabled site-wide. If the plugin includes a controller, check that is has a beforeFilter method, and that it includes a call to Auth telling it which actions should not be blocked. public function beforeFilter() { parent::beforeFilter(); $this-Auth-allow(array('index', 'view')); // etc. } On Mon, Mar 4, 2013 at 7:59 PM, David Camerotto djcam...@gmail.com wrote: My apologies in advance, i am still relatively new to CakePHP. I took over a site a number on months ago and have slowly worked out how thing operate. (http://www.musicformywedding.com.au/) One issue that has me stumped is access to a custom plugin for FAQs, you can only access this page if logged in. I cannot work out where the code is to control this, i have looked in the plugins controller but it seems to only affect the admin page for creating the FAQs. I even created a new plugin that was identical to the FAQ plugin apart from the naming conventions (called it questions) and it still asks you to login, does this mean that all plugins need authentication. Any help much appreciated Regards David -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Setting the Value of Options in a drop down...
On Tue, Mar 5, 2013 at 6:17 PM, April DeRossett april.deross...@gmail.com wrote: Hello! Here is what I have in my view: if($biddetail['Biddetail']['Sold'] == 'SOLD'){$otherstate = 'OPEN';} else {$otherstate = 'SOLD';} echo $this-Form-input('Sold', array('options' = array($otherstate),'empty' = $biddetail['Biddetail']['Sold'])); Is there no way to set the value to equal to the option? ie value = 'SOLD' rather than value = '0'. As you can see above the values change based on the current value populated in the data base... I don't want to have to go back and add a table to hold two values that will never change. Any solutions? I have already read the documentation at: http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html which does not provide a solution for this question. The manual has no solution to your question because you're going about it the wrong way, I'm afraid. If you'll only ever have 2 states (*) you may as well make the table column a bit (1/0). You've named it Sold (more on that in a sec) so presumably a 1 would represent yes. You could reverse this and name the column open. In any case, you could then simply use a checkbox. I can't offer any more without seeing your table schema, although your column names should be all lowercase. Normally, your model would be BidDetail, and the table bid_details, but it's not really so important as long as you're consistent. (*) And are you absolutely certain of that? If not, bite the bullet and go make that other table and use find('list') to get what you need. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: CakePHP 2.3.1 released
Hi, I have downloaded the latest stable version of CakePHP and tried to implement the blog tutorial given in Book 2.x. I have followed all the steps but my posts table can be added only created and modified columns. Title and body were as NULL only. When I made the debug mode to 2, i got the query which had only created and modified columns in the INSERT INTO... Please help me out. Thanks in advance. -U On Sunday, March 3, 2013 11:32:43 AM UTC+8, mark_story wrote: The CakePHP core team is proud to announce the immediate availability of CakePHP 2.3.1[1]. 2.3.1 is a bugfix release for the 2.3 release branch. Since the release of 2.3.0 there have been 70 commits and 20 tickets resolved. A short list of the changes you can expect is: * The ServerShell now correctly handles plugin and theme assets. * FormHelper::inputs() now correctly handles plugin models. * Backwards compatibility for HABTM checkboxes has been improved. * Schema generation works better with SQLServer now. * Baking models better detects has and belongs to many associations. * Security::rijndael() now correctly generates random iv values. It will continue to decrypt values encrypted with a fixed iv. This improves security of encrypted values, by preventing dictionary attacks on the key/value. * Altering tables with Postgres properly renames fields now. * Regular expression operators are better supported in Postgres. * Fatal errors now display when gzip encoding is enabled. * Model whitelists are restored when a save() fails due to no data, when a model has no created/updated fields. * Validation::$errors is no longer populated with booleans, this prevents memory consumption issues in longer running scripts. In addition to the release of 2.3.1, the API docs have been updated and replaced with a system based on [apigen](http://apigen.org). The new API docs fix a number of issues with the old docs and provides an easy way for you to create local API docs. A huge thanks to all involved in terms of both contributions through commits, tickets, documentation edits, and those whom have otherwise contributed to the framework. Without you there would be no CakePHP. Download a packaged release [2]. ### Links * [1] http://cakephp.org/changelogs/2.3.1 * [2] http://github.com/cakephp/cakephp/tags -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: File Upload Tutorial
Boss! Keith =) kindly post a 'download link' here in this tutorial. because it's really weary for me to read than to analyse.. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
unbind field
Is there any way to unbind field ? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
How to call a function from a different controller
Hi, I'll explain the context of my problem: In my project there are companies and students, companies publish job opportunities and students can apply for these. Both companies and students inherit features from users object. So, you have users, companies and students. In my users controller I manage things related to users: auth, send messages between users, send email notifications, etc. My problem is: When a student apply to a job opportunity, the app should register its apply and send a message (which is managed by users controller) Basically I have this: class Users extends AppController{ ... function sendMessage(){ //data is recieved by post method } } class Opportunity extends AppController{ ... function registerApply(){ //Here I should call the sendMessage() function with data } } I've readed some ideas to do this, but I don't understand how to call an external function and send POST data. Thanks for your help. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: search filter in cake 1.3
anyone,...? -- View this message in context: http://cakephp.1045679.n5.nabble.com/search-filter-in-cake-1-3-tp5713935p5713955.html Sent from the CakePHP mailing list archive at Nabble.com. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
How to install CakePHP 2.x on OS X 10.8?
I'm new to CakePHP and am trying to configure my MacBook Pro running OS X 10.8 as a developer machine. I already have Apache, MySQL, PHP 5.x installed and they all work fine. I'm unable to get CakePHP to work and cannot find any instructions that work for my situation - did watch a couple of videos and looked into the documentation. Can anyone provide me some assistance with this task? I have the latest version of all software running and have unzipped the CakePHP download. I did copy the Cake folders into the root of my web server. I receive the following error when I go to the folder on my localhost using Firefox. I'm sure I'm missing something important for this configuration. Thank you. *Warning*: strtotime() [function.strtotimehttp://localhost/cake2/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 'America/Chicago' for 'CST/-6.0/no DST' instead in * /Library/WebServer/Documents/cake2/lib/Cake/Cache/CacheEngine.php* on line * 60* *Warning*: _cake_core_ cache was unable to write 'cake_dev_en-us' to File cache in */Library/WebServer/Documents/cake2/lib/Cake/Cache/Cache.php* on line *310* *Warning*: /Library/WebServer/Documents/cake2/app/tmp/cache/persistent/ is not writable in * /Library/WebServer/Documents/cake2/lib/Cake/Cache/Engine/FileEngine.php* on line *337* *Fatal error*: Uncaught exception 'CacheException' with message 'Cache engine _cake_core_ is not properly configured.' in /Library/WebServer/Documents/cake2/lib/Cake/Cache/Cache.php:166 Stack trace: #0 /Library/WebServer/Documents/cake2/lib/Cake/Cache/Cache.php(136): Cache::_buildEngine('_cake_core_') #1 /Library/WebServer/Documents/cake2/app/Config/core.php(342): Cache::config('_cake_core_', Array) #2 /Library/WebServer/Documents/cake2/lib/Cake/Core/Configure.php(77): include('/Library/WebSer...') #3 /Library/WebServer/Documents/cake2/lib/Cake/bootstrap.php(164): Configure::bootstrap(true) #4 /Library/WebServer/Documents/cake2/app/webroot/index.php(95): include('/Library/WebSer...') #5 /Library/WebServer/Documents/cake2/index.php(43): require('/Library/WebSer...') #6 {main} thrown in * /Library/WebServer/Documents/cake2/lib/Cake/Cache/Cache.php* on line *166* -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Cakephp 2.3.x Sending Files and forcing the download of a mp4 file
I'm using cakephp 2.3.1 I want to force download a mp4 file per http://book.cakephp.org/2.0/en/controllers/request-response.html#cake-response-file In my 'view' I have the following code which is correctly searching for the filename, and finding the file name, and displaying the download link: ?php $filename = APP . 'webroot/files/' . $dance['Dance']['id'] . '.mp4'; if (file_exists($filename)) { echo $this-Html-link('DOWNLOAD', array('controller' = 'dances', 'action' = 'sendFile', $dance['Dance']['id'])); } else { echo 'Coming soon: available April 16th'; }? When the user clicks on the link I want to force the download of the mp4 file. In my controller I have the following code that doesn't work: public function sendFile($id) { $file = $this-Attachment-getFile($id); //Note: I do not understand the 'Attachment' and the 'getFile($id)' $this-response-file($file['webroot/files/'], array('download' = true, 'name' = 'Dance')); //Return reponse object to prevent controller from trying to render a view return $this-response;} I don't understand 'Attachment' and the 'getFile()' I'm getting the following error: Error: Call to a member function getFile() on a non-object What am I doing wrong and is there any other documentation I can be looking at to understand this better? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: How to call a function from a different controller
Move the send message to the AppController. On Mar 5, 2013 8:50 PM, rd...@reclutec.com wrote: Hi, I'll explain the context of my problem: In my project there are companies and students, companies publish job opportunities and students can apply for these. Both companies and students inherit features from users object. So, you have users, companies and students. In my users controller I manage things related to users: auth, send messages between users, send email notifications, etc. My problem is: When a student apply to a job opportunity, the app should register its apply and send a message (which is managed by users controller) Basically I have this: class Users extends AppController{ ... function sendMessage(){ //data is recieved by post method } } class Opportunity extends AppController{ ... function registerApply(){ //Here I should call the sendMessage() function with data } } I've readed some ideas to do this, but I don't understand how to call an external function and send POST data. Thanks for your help. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: How to install CakePHP 2.x on OS X 10.8?
try these : change /etc/php.ini date.timezone to: date.timezone = 'America/Chicago' make tmp folder writeable: sudo chmod -R 777 /Library/WebServer/Documents/cake2/app/tmp/ also all you setup issues is listed here: http://book.cakephp.org/2.0/en/installation.html Andras Kende http://www.kende.com On Mar 5, 2013, at 1:55 PM, BoiceNet boice...@gmail.com wrote: I'm new to CakePHP and am trying to configure my MacBook Pro running OS X 10.8 as a developer machine. I already have Apache, MySQL, PHP 5.x installed and they all work fine. I'm unable to get CakePHP to work and cannot find any instructions that work for my situation - did watch a couple of videos and looked into the documentation. Can anyone provide me some assistance with this task? I have the latest version of all software running and have unzipped the CakePHP download. I did copy the Cake folders into the root of my web server. I receive the following error when I go to the folder on my localhost using Firefox. I'm sure I'm missing something important for this configuration. Thank you. Warning: strtotime() [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 'America/Chicago' for 'CST/-6.0/no DST' instead in /Library/WebServer/Documents/cake2/lib/Cake/Cache/CacheEngine.php on line 60 Warning: _cake_core_ cache was unable to write 'cake_dev_en-us' to File cache in /Library/WebServer/Documents/cake2/lib/Cake/Cache/Cache.php on line 310 Warning: /Library/WebServer/Documents/cake2/app/tmp/cache/persistent/ is not writable in /Library/WebServer/Documents/cake2/lib/Cake/Cache/Engine/FileEngine.php on line 337 Fatal error: Uncaught exception 'CacheException' with message 'Cache engine _cake_core_ is not properly configured.' in /Library/WebServer/Documents/cake2/lib/Cake/Cache/Cache.php:166 Stack trace: #0 /Library/WebServer/Documents/cake2/lib/Cake/Cache/Cache.php(136): Cache::_buildEngine('_cake_core_') #1 /Library/WebServer/Documents/cake2/app/Config/core.php(342): Cache::config('_cake_core_', Array) #2 /Library/WebServer/Documents/cake2/lib/Cake/Core/Configure.php(77): include('/Library/WebSer...') #3 /Library/WebServer/Documents/cake2/lib/Cake/bootstrap.php(164): Configure::bootstrap(true) #4 /Library/WebServer/Documents/cake2/app/webroot/index.php(95): include('/Library/WebSer...') #5 /Library/WebServer/Documents/cake2/index.php(43): require('/Library/WebSer...') #6 {main} thrown in /Library/WebServer/Documents/cake2/lib/Cake/Cache/Cache.php on line 166 -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: How to call a function from a different controller
I would suggest making a custom component, it's more in line with your needs. Also, it doesn't open up the sendMessage to the entire app. Here's how to do it: Creating a custom componenthttp://book.cakephp.org/2.0/en/controllers/components.html#creating-a-component -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: unbind field
Yup, Bind/Unbind models.http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html#creating-and-destroying-associations-on-the-fly More specifically, from the book: public function some_action() { // This fetches Leaders, and their associated Followers $this-Leader-find('all'); // Let's remove the hasMany... $this-Leader-unbindModel( array('hasMany' = array('Follower')) ); // Now using a find function will return // Leaders, with no Followers $this-Leader-find('all'); // NOTE: unbindModel only affects the very next // find function. An additional find call will use // the configured association information. // We've already used find('all') after unbindModel(), // so this will fetch Leaders with associated // Followers once again... $this-Leader-find('all');} -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: How to call a function from a different controller
As you want to use the function for multiple controllers, so there are two ways to achieve this, 1. Add this method to App controller : use it via $this-methodname() in your controller 2. Create a component which will be used in required places, which will be generic for that functionality. (This is the best way to use) On Wednesday, March 6, 2013 12:22:06 AM UTC+5:30, rd...@reclutec.com wrote: Hi, I'll explain the context of my problem: In my project there are companies and students, companies publish job opportunities and students can apply for these. Both companies and students inherit features from users object. So, you have users, companies and students. In my users controller I manage things related to users: auth, send messages between users, send email notifications, etc. My problem is: When a student apply to a job opportunity, the app should register its apply and send a message (which is managed by users controller) Basically I have this: class Users extends AppController{ ... function sendMessage(){ //data is recieved by post method } } class Opportunity extends AppController{ ... function registerApply(){ //Here I should call the sendMessage() function with data } } I've readed some ideas to do this, but I don't understand how to call an external function and send POST data. Thanks for your help. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
How to define a checkbox variable in Cakephp
I have a form in my Plugin elements and what i would like to insert the checkbox value into a table named it_queries and field status_type and its giving me an error Undefined variable: variableValue [APP\Plugin\Feedback\View\Elements\comment_add.ctp, line 37] .I have declared the variable in my controller like this $this-set('variableValueStatus', 'Pending'); and this is line 37 thats giving me the error Below is the Controller code class CommentsController extends FeedbackAppController { public $components = array('Feedback.Comments'); public function add($foreign_model = null, $foreign_id = null) { if (empty($foreign_model) || empty($foreign_id) || !$this-request-is('post') ) { $this-set('variableValueStatus', 'Pending'); return $this-redirect('/'); } //Other code } and in the add view in my element here is how i am trying to accessing the variable value echo $this-Form-checkbox('ItQuery.status_type', array('type' = 'hidden', 'value'=$variableValueStatus)); If someone can show me how to fix this, that would be awesome -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.