I don't understand the Form user guide |
[eluser]phantom-a[/eluser]
I'm looking in the User guide for making Forms I don't understand how it means for the code to be used. Do you put the code in the controller or the View? Here is Qoute for example. Code: form_dropdown() umm where do I put that code?
[eluser]textnotspeech[/eluser]
IMO, the form helper is for dynamically generated forms or specific use-case scenarios. In which case, you'd put it in the controller. Otherwise, I see no point to over-complicate something as simple as an HTML form. 95% of the time I simply put forms in the view the old fashioned way. There's no need to use php to generate something that can be done with static HTML. Just because there's a programmatic way to do something, doesn't mean you should. In general I try to avoid putting any php other than variables and arrays (foreach loops) in my views. A view shouldn't "process" information, it should display it.
[eluser]plainas[/eluser]
This is exactly where things get a bit blurry. Like.. abstraction is the way and everything but no matter what one does, whatever kind of application we're talking about, there will ALWAYS be areas where abstraction layers overlay. I follow a bit textnospeech's approach, but that's not always the best. Say you want to pass the view files to a designer, the less black boxes the best. I guess the answer is: think ahead. Which part of the code is more likely be submitted to changes, how soon, how often...
[eluser]metaltapimenye[/eluser]
[quote author="tomcode" date="1221544028"]Both is possible.[/quote] yup, i agree.. why dont you try in your controller index? Code: ...
[eluser]tomcode[/eluser]
There's another thread going which discusses why using the CI helpers form/html instead plain HTML. What's the benefit ... |
Welcome Guest, Not a member yet? Register Sign In |