Hello
I build a component which the controller make some actions which return array with values. Those values need to manipulate the page that open after the controller make the actions.
I need some action to pass values to the model or view directly without setRedirect method. How could I do that?
Thanks
Controller interation with Model-View
-
- Joomla! Enthusiast
- Posts: 215
- Joined: Wed Oct 10, 2007 9:46 am
- Location: Israel, TA
- Contact:
Controller interation with Model-View
http://www.embad.com - new way to insert ads to your website
-
- Joomla! Explorer
- Posts: 458
- Joined: Mon Aug 11, 2008 1:16 am
- Location: Newburgh Ny , USA
- Contact:
Re: Controller interation with Model-View
set a task for the controller to intercept and process.oc666 wrote:Hello
I build a component which the controller make some actions which return array with values. Those values need to manipulate the page that open after the controller make the actions.
I need some action to pass values to the model or view directly without setRedirect method. How could I do that?
Thanks
use JReqest::getVar() to capture POST vars.
use setVar() to set what view or layout you want.
Learn something new every day!
-
- Joomla! Enthusiast
- Posts: 215
- Joined: Wed Oct 10, 2007 9:46 am
- Location: Israel, TA
- Contact:
Re: Controller interation with Model-View
Could you give me an example or some more info, please?becyn wrote: set a task for the controller to intercept and process.
use JReqest::getVar() to capture POST vars.
use setVar() to set what view or layout you want.
Thanks
http://www.embad.com - new way to insert ads to your website
-
- Joomla! Explorer
- Posts: 458
- Joined: Mon Aug 11, 2008 1:16 am
- Location: Newburgh Ny , USA
- Contact:
Re: Controller interation with Model-View
See the tutorials and APIoc666 wrote:Could you give me an example or some more info, please?becyn wrote: set a task for the controller to intercept and process.
use JReqest::getVar() to capture POST vars.
use setVar() to set what view or layout you want.
Thanks
http://docs.joomla.org/
A good book on this is "Mastering Joomla 1.5".
Learn something new every day!
-
- Joomla! Enthusiast
- Posts: 215
- Joined: Wed Oct 10, 2007 9:46 am
- Location: Israel, TA
- Contact:
Re: Controller interation with Model-View
I read about it and I've one last question. If I use JReqest::setVar() and then redirect to other page. Could I use the variables I set in the page I redirect into?becyn wrote:
See the tutorials and API
http://docs.joomla.org/
A good book on this is "Mastering Joomla 1.5".
Thanks
http://www.embad.com - new way to insert ads to your website
-
- Joomla! Explorer
- Posts: 458
- Joined: Mon Aug 11, 2008 1:16 am
- Location: Newburgh Ny , USA
- Contact:
Re: Controller interation with Model-View
If you mean the variables collected from a post method, the answer is yes. Assign the references in the the layout view.oc666 wrote:I read about it and I've one last question. If I use JReqest::setVar() and then redirect to other page. Could I use the variables I set in the page I redirect into?becyn wrote:
See the tutorials and API
http://docs.joomla.org/
A good book on this is "Mastering Joomla 1.5".
Thanks
Note that the contents of the last post operation is what will be in the array.
The best way to get a feel for it is to do some experimentation to find out how these things work.
Learn something new every day!
-
- Joomla! Fledgling
- Posts: 3
- Joined: Mon Apr 14, 2008 8:56 am
- Contact:
Re: Controller interation with Model-View
maybe this could help
$view=&$this->getView($viewName,$viewType);
$view->assignRef('mBooks', $mBooks);
$view->assignRef('mWorks', $mWorks);
you set new var mWorks and give it value of $mWorks
$view=&$this->getView($viewName,$viewType);
$view->assignRef('mBooks', $mBooks);
$view->assignRef('mWorks', $mWorks);
you set new var mWorks and give it value of $mWorks
Taras Remez
http://taraska.ru
http://taraska.ru