Probleme FormHelper

Par arcoss 3x, il y a 10 ans


Bonsoir,
Je suis en train de creer un site web avec cakephp et j'ai un probleme lors de la creation du formulaire d'editon de compte, il me met ça :

Missing Helper Error: FromHelper could not be found. Error: Create the class FromHelper below in file: app\View\Helper\FromHelper.php <?php class FromHelper extends AppHelper { } Notice: If you want to customize this error message, create app\View\Errors\missing_helper.ctp Stack Trace CORE\Cake\View\HelperCollection.php line 63 → HelperCollection->load(string) CORE\Cake\View\View.php line 858 → HelperCollection->__isset(string) APP\View\Users\edit.ctp line 5 → View->__get(string) CORE\Cake\View\View.php line 971 → include(string) CORE\Cake\View\View.php line 933 → View->_evaluate(string, array) CORE\Cake\View\View.php line 473 → View->_render(string) CORE\Cake\Controller\Controller.php line 960 → View->render(null, null) CORE\Cake\Routing\Dispatcher.php line 200 → Controller->render() CORE\Cake\Routing\Dispatcher.php line 167 → Dispatcher->_invoke(UsersController, CakeRequest) APP\webroot\index.php line 118 → Dispatcher->dispatch(CakeRequest, CakeResponse)

Voici ma fonctionn edit :

function edit(){ $user_id = $this->Auth->user('id'); if(!$user_id){ $this->redirect('/'); die(); } $this->User->id = $user_id; $this->request->data = $this->User->read(); }

Et mon formulaire :

<?php $this->set('title_for_layout',"Efiter mon profil"); ?> <?php echo $this->Form->create('User'); ?> <?php echo $this->From->input('firstname',array('label'=>"Prénom :")); ?> <?php echo $this->From->input('lastname',array('label'=>"Nom :")); ?> <?php echo $this->From->input('pass1',array('label'=>"Mot de passe :")); ?> <?php echo $this->From->input('pass2',array('label'=>"Confirmation de mot de passe :")); ?> <?php echo $this->Form->end('Modifier'); ?>

Merci d'avance pour l'aide fourni !

2 réponses

Lartak, il y a 10 ans

Bonsoir.
C'est normal.
Ce n'est pas $this->From mais $this->Form.
Il n'y a pas de Helper From sur CakePHP, mais un Helper Form, comme formulaire.

arcoss 3x, il y a 10 ans

Merci ca fonctionne !