Welcome Guest, Not a member yet? Register   Sign In
HTML and Forms helpers
#1

[eluser]_TTT_[/eluser]
CI has HTML and FORMS helpers for what ?
I cant understed why those functions
For example

CI

echo form_open('email/send');
echo form_input('username', 'Alex');
echo form_close($string);

in Clear HTML

<form method="post" action="post/send">
<input type="text" name="username" value="Alex" />
</form>

what is reason ?
#2

[eluser]prestondocks[/eluser]
You could use either, however using the CI version gives you or someone else editing your code in the future the option to create the form elements as an array in the controller.

There is differing opinion on what to use. some people like it, others believe it adds to much PHP to your view.

You may want to take a look at this post, which discusses the same question and has a number of responses.

http://ellislab.com/forums/viewthread/158843/

Thanks
Simon
#3

[eluser]Fireclave[/eluser]
this is shorter, because you can make your PHP code and then your html code i.e.

$mail = array(
'name' = 'email',
'id' = 'id',
'value' = set_value('email', 'default value')
);
...

echo form_open('abc/def');
echo 'Email:' . form_input($mail);
echo form_close();




Theme © iAndrew 2016 - Forum software by © MyBB