[eluser]Milos Dakic[/eluser]
[quote author="Colin Williams" date="1219541306"]Honestly, I'm not sure what's required to get method chaining to work, but I would assume a method must return a reference to the object for each method that is chainable. You would just have to make it two lines as far as I know:
Code:
$this->template->add_region('region');
$this->template->write('region', 'content');
Quote:I’m not sure if this is possible that why I made the suggestion in the previous post. To adjust the header content attribute I’d need to so something like...
Still not sure if I'm following, but you can overwrite a regions contents by passing a third param of TRUE to the write() method, like $this->template->write('region', 'content', TRUE). You can also clear out a region with $this->template->empty_region('region')[/quote]
The region's issue (?) that I'm having is with multi dimension arrays. How can I set their values? Say if I have something like:
Code:
$template['theme_name']['regions'] = array(
'header' => array(
'title' => 'Title',
'account' => 'Anonymous'
),
'navigation' => array(
'selected' => 1,
'type' => 'classic'
),
'content' => 'Heaps of text can go here.',
'footer' => 'Goodbye!'
);
How would I go about setting for example the 'title' in the 'header'? Or any other item that is not in the first layer?