Thanks Joshua,
to summarize:
I include the helper in my controller:
__________________________________
class PostsController extends AppController {
var $helpers = array('Html', 'Form');
__________________________________
Then I can use the <?=$form->submit(); ?>
One thing to note is that this generates by default:
<div class="submit"><input type="submit" value="Submit" /></div>
Which is not very obvious, the default should be <input type="submit"
value="Submit" /> only.
To REMOVE it:
( looking at the class http://api.cakephp.org/1.2/form_8php-source.html#l00728
)
#1 $submitoptions=array('div'=>false);
#2 $form->submit('caption',$submitoptions);
You can also put line #1 in the controller methods:
$this->set('submitoptions', array('div'=>false) );
What I couldn't do is add this for all methods, maybe I should place
it in another part and not in the constructor, since adding a
constructor is not good :
class PostsController extends AppController
{
var $helpers = array('Html', 'Form');
var $name = 'Posts';
function __construct() {
}
[[ X Crashes completely ]]
Martin
On Jun 11, 2:21 pm, Joshua Benner <[EMAIL PROTECTED]> wrote:
> For submit:
>
> IncludetheFormHelperin your controller, then use:
>
> $form->submit() (see 1.2 api athttp://api.cakephp.org/1.2)
>
> personally, I use (from the controller): $this->flash('message', $url)
>
> Again, refer to api for more details.
>
>
>
> Martin wrote:
> > Hello bakers,
> > I 've successfully created my first blog with cake using the example
> > at:
> >http://manual.cakephp.org/appendix/blog_tutorial
>
> > Two things I wanted to comment for this example:
>
> > 1- /app/views/posts/add.thtml
>
> > <?php echo $html->submit('Save') ?>
> > IS DEPRECATED.
>
> > What is the other method we need to use to get the SUBMIT buttons
> > working in 1.2 ?
>
> > 2- /app/views/posts/add.thtml
>
> > <?php echo $html->tagErrorMsg('Post/body', 'Body is required.') ?>
>
> > Error messages are not getting printed. I suppose that this is because
> > this $html methods are deprecated (Same as point 1)
>
> > But is working so far. Love it.
>
> > If there are more Cake examples around there, and I would love to see
> > AJAX thingies / REST apps / APIs and such, please post a reply or
> > point me to some URL's.
>
> > MARTIN
>
> --
> Joshua Bennerhttp://bennerweb.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---