Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
General
Issue about Theme and HMVC Request
Syntaxlb
April 2014
Hi,
I use Theme for my project. Here is my template controller :
http://bin.fuelphp.com/snippet/view/BP
My action widget :
public function get_widget()
{
if (\Request::is_hmvc())
{
return \View::forge('backend/widget')->set($this->data);
}
}
When i do this in an action :
$this->theme->get_template()->set('pageTitle', __('url.title.manage_all'));
\Debug::dump($this->theme->get_template()->get('pageTitle'));
$this->data['widget'] = \Request::forge('url/backend/index/widget', false)->execute();
\Debug::dump($this->theme->get_template()->get('pageTitle'));
The 1st dump show the pageTitle, but the second return error :
OutOfBoundsException [ Error ]:
View variable is not set: pageTitle
Why the HMVC Request re-initialize all my template vars ?
Harro
April 2014
Accepted Answer
It looks like that HMVC call redefines your template? That will load the View again, making you loose all variables.
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,088
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
260
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Harro
April 2014