• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Way to define $data array for all functions inside a class

#3
[eluser]gwelter[/eluser]
pistolPete sounds right on. I was doing the same data preparation for certain header data across multiple classes, and I ended up writing a helper function for it called header_prep(). When I call the header, I simply use array_merge:

Code:
$this->load->view('header', array_merge(header_prep(), 'page_title' => 'My Page'));

This wouldn't apply to static data in a single class, but I thought I'd mention it anyway.


Messages In This Thread
Way to define $data array for all functions inside a class - by El Forum - 08-21-2009, 02:58 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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