returning the value of a variable from controller to form or

For programming and general questions on Zend Framework

returning the value of a variable from controller to form or

Postby cp_almora on Sat Jun 06, 2009 11:51 am

hi everybody
actually i am new to zend framework. I know that i can return a value of a variable from a form to the controller. Can I also return a value from the controller to any form or any model? If this is possible then please tell me that how can we do it.

Thanks in advance.
cp_almora
 
Posts: 1
Joined: Sat Jun 06, 2009 11:50 am

Re: returning the value of a variable from controller to form or

Postby brunitto on Mon Jun 08, 2009 4:27 pm

It is possible but you should avoid it, you are in front of a modelling problem: probably your application issue is allocated in the wrong place.

You should keep your controllers thin and all of your application's rules will be in your models. Take a new breath and think in a good reason for a controller to return a value. In other hand, the model can be accessed from Forms, Controllers and even views - although it access should be restricted.

Do not worry, this is a new comer problem in MVC architecture, I also tried to fill my controllers with application rules in my start... lol
Ookie dookie!
brunitto
 
Posts: 111
Joined: Fri May 29, 2009 10:10 pm
Location: São Paulo - Brazil

Re: returning the value of a variable from controller to form or

Postby dhaval4linux on Thu Jun 11, 2009 6:59 am

to access value in to form pass parameter to constructor of form, For accessing value from form to controller, you need to make that variable public or create method in form which access that variable and return that variable,
no direct way you can access that.
Best Regards,
Dhaval
dhaval4linux
 
Posts: 161
Joined: Fri May 22, 2009 2:35 pm


Return to Zend Framework

Who is online

Users browsing this forum: timvansteenbergen and 5 guests