MVC Hierarchy question.

#3
[eluser]xwero[/eluser]
Why do you need a controller for data? You could create a model method that outputs your data the way you want to see it in your footer.

Or are you talking about a form in your footer that needs to be submitted. Then you could make a controller method that is only used to process the submit and redirect to the page the user was on when the form was submitted.
Code:
//view
<div id="footer">
&lt;form action="/someclass/somemethod" method="post"&gt;
&lt;input hidden="redirect" value="/otherclass/othermethod"&gt; &lt;!-- changes per page --&gt;
...
&lt;/form&gt;
</div>
// controller
someclass extends controller
{
   ...
  
   function somemethod()
   {
      // validation, regenerate footer data
      redirect($this->input->post('redirect'));
   }
}


Messages In This Thread
MVC Hierarchy question. - by El Forum - 12-25-2007, 05:52 PM
MVC Hierarchy question. - by El Forum - 12-25-2007, 10:38 PM
MVC Hierarchy question. - by El Forum - 12-26-2007, 02:13 AM
MVC Hierarchy question. - by El Forum - 12-26-2007, 04:12 AM
MVC Hierarchy question. - by El Forum - 12-26-2007, 04:25 AM
MVC Hierarchy question. - by El Forum - 12-26-2007, 05:26 AM
MVC Hierarchy question. - by El Forum - 12-26-2007, 09:03 PM
MVC Hierarchy question. - by El Forum - 12-26-2007, 11:59 PM
MVC Hierarchy question. - by El Forum - 12-30-2007, 05:30 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.