Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

set var on controller 09 Apr 2015 13:23 #12907

  • albert
  • albert's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 70
  • Thank you received: 2
Hi,
on a function of a controller i can get correctly vars by doing:

$jinput = JFactory::getApplication()->input;
$entry_id = $jinput->get('participant_id', null);

but when i try to set a var to recover on the view.html it doesn't work,
either if i do
$jinput->set('result',$result);
as
JRequest::setVar('result',$result);

i can't recover any data in the view.html.php

I could try to use the array of redirection, but i want to pass an object.

Please Log in or Create an account to join the conversation.

set var on controller 13 May 2015 12:17 #12978

I do not exactly understand what you need, but in the controller you can set the state on the model:

$model = $this->getModel(); 
$model->setState('result',$result);

Then in your view you can pull that info in your view
$result = $model->getState('result');

Does that help?

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.049 seconds

  I found "cook" two days ago. Played around with it for a day and then within a day got rid of two legacy applications in IBM Lotus Domino Notes and replaced them with "cook". It was really easy. A piece of cake. Actually it was even easier than cooking. Cooking involves more work than developing with "cook". What can I say about "cook"? Great application great price for what it delivers great forum with a lot of information and fast responses active and friendly community fast forward moving development cycle So what should I say "Monsieur Le Cook"? Keep the good work going it will lead to success. Having become a paying member in the words of Edith Piaf may I say ..... non rien de rien ... je ne regrette rien. Vive La France.
FK (JED)
         

Get Started