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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to