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
Sending parameter value in viewmodel
Gaurish
September 2014
i want to send parameter in view model.
i have tryed to do this
Response::forge(ViewModel::forge('template/productslist','category',123,$view));
at the viewmodel
class View_Template_Productslist extends ViewModel
{ public function category($at)
{
$this->list = Model_Product::get_product_all($at);
}
but it is not working , theri is error saying 1 arrgument missing
please help
Harro
September 2014
Accepted Answer
Viewmodel::forge() doesn't have the option to pass variables, like a View has.
So you need to use:
- set()
- set_safe()
- property assignment ( like $viewmodel->at = 123; )
In the Viewmodel, you use $this->at to retrieve the value...
Gaurish
September 2014
thank you very much sir it really help.
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
Gaurish
September 2014
Harro
September 2014