views:

43

answers:

2

Hey,

I was wondering, is there any easy way to have the html generated by codeigniter be more structured and more readable? For example, if I do this:

 echo form_open('do/send',array("id" => "contact_form"));

 echo form_label("Name:", "name");
 echo form_input(array("name" => "name"));
 echo form_submit("submit", "Submit");
 echo form_close();

The html generated will be in one single line and no structure. I could do something like this:

echo form_submit("submit", "Submit")."\n";

But that's not really practical.

Any ideas?

+3  A: 

Reading through CodeIgniter Form Creating Library it seems that your options are either manually putting in the \n, like you suggested or put it in the html mockup and space it out that way (for this see the referenced page under: Open "books_input.php" within CodeIgniter\system\application\views. Update like following code:)

Brad F Jacobs
I might just stick with html forms, it's easier and looks better. Thanks for your reply!
Sled
Yeah the CI form and table classes are pretty dire.
DRL
A: 

You should try Dan Horrigan's Formation library. It's much nicer than CodeIgniter's helper output, and easier to use, also.

Zack