Global functions

#15
[eluser]cahva[/eluser]
If you're sending $data to view:
Code:
$data['variable_name'] = 'Foo';

$this->load->view('layout',$data);

..then you would reference it as $variable_name in the view.

EDIT: misread sorry. You ofcourse have to send the $data to your lib or model.
BTW, If you need some information in almost every page, you should concider MY_Controller technique where you extend from that. Or even better, take advantage of autoloading classes in PHP5 and use technique described here by Phil Sturgeon.


Messages In This Thread
Global functions - by El Forum - 08-18-2010, 10:02 PM
Global functions - by El Forum - 08-19-2010, 12:44 AM
Global functions - by El Forum - 08-19-2010, 01:15 AM
Global functions - by El Forum - 08-19-2010, 08:30 AM
Global functions - by El Forum - 08-19-2010, 08:37 AM
Global functions - by El Forum - 08-19-2010, 08:45 AM
Global functions - by El Forum - 08-19-2010, 08:55 AM
Global functions - by El Forum - 08-19-2010, 09:31 AM
Global functions - by El Forum - 08-19-2010, 11:04 AM
Global functions - by El Forum - 08-19-2010, 11:27 AM
Global functions - by El Forum - 08-19-2010, 11:29 AM
Global functions - by El Forum - 08-19-2010, 11:39 AM
Global functions - by El Forum - 08-19-2010, 11:43 AM
Global functions - by El Forum - 08-30-2010, 12:06 PM
Global functions - by El Forum - 08-30-2010, 02:26 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.