function end() on a non-object

Par Aymenkn, il y a 14 ans


Fatal error: Call to a member function end() on a non-object in C:\wamp\www\cakephp1\app\View\Posts\edit.ctp on line 3

<?php
echo $this->Form->create('Post',array('url'=>array('action'=>'edit')));
echo $from->end("Envoyer");
?>

2 réponses

xam1311, il y a 14 ans

tu a du prendre du code de cake 1.3 pour la fin
le end sans autre précision te mets automatiquement le bouton d'envoi , mais après tu peux créer tes propres boutons

<?php echo $this->Form->submit('Enregistrer ', array(
      'class'=>'btn btn-primary',
      'div'=>false));
      echo $this->Form->button('Annuler',array(
      'type'=>'reset',
      'class'=>'btn'));
      echo $this->Form->end();