⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

How to pass data to the view



reynierpm
  • profile picture
  • Member

Posted 13 April 2012 - 00:35 AM

I notice that in examples are used $output as variable passed to the view but if I have some others vars setup in $data, how to pass them to the view too? Can I do something like $output['value'] without affect the grocery crud output?

xxaxxo
  • profile picture
  • Member

Posted 13 April 2012 - 06:10 AM

You can do it as you like, I personally prefer storing the $output in an array ... I have something like this

$view_arr = array(
'grocery_output' => $output,
'my_var' => $my_var
);

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 13 April 2012 - 06:29 AM

Or you can do it like this:


$output = (array)$output;
$output['value'] = "Your value here";