Hi,
I did not want to type echo statements into my views so I took the
suggestion of the CakePHP docs and added the following function to my
app_helper:

public function output($string)
{
     echo parent::output($string."\n");
}

And I use it like this:

        <?php
                $form->create($options = array('action' => 'login'));
                $form->input('User.username');
                $form->input('User.password');
                $form->button(__('Login', true), array('type'=>'submit',
'class'=>'ui-state-default'));
                $form->end();
        ?>

The output looks like this:

<form id="LoginForm" method="post" action="/users/login">
<label for="UserUsername">Username</label>
<input name="data[User][username]" type="text" value=""
id="UserUsername" />
<div class="input text"></div>
<label for="UserPassword">Password</label>
<input type="password" name="data[User][password]" value=""
id="UserPassword" />
<div class="input password"></div>

<input type="submit" value="Login" class="ui-state-default" />
</form>


Why are the inputs not inside the divs where they belong? If I remove
the function and replace the echos for each of the form elements it
works. Seems wrong that I can write a function so that I dont have to
type an echo when using the helpers but then I have to manually add
the containing div.

One other related question. How do I accomplish using  the Html helper
method tableCells and placing form elements in the cells? I put the
form element method as an element of the array that is passed to the
tableCells method I get no output.

Any help would be appreciated.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to