*Notice* (8): Undefined variable: form me esta votando este error al crear una
vista y un controlador lo estoy probando como ejemplo
el codigo que tengo en cotroller es este
<?php
class UsersController extends AppController{
var $name='Users';
var $uses = array();
function index(){
if( !empty($this->data)){
echo $this->data['nombre'];
$this->autoRender = false;
}
}
}
?>
y el que tengo en dentro de la carpeta view eh creado una carpeta llamado
users y ahi tengo un index. ctp
<?php
class UsersController extends AppController{
var $name='Users';
var $uses = array();
function index(){
if( !empty($this->data)){
echo $this->data['nombre'];
$this->autoRender = false;
}
}
}
?>
pero al ejecutar me vota este error:
*Notice* (8): Undefined variable: form [*APP\View\users\index.ctp*, line *1*]
Code Context
<?php echo $form->create(null, array('action'=>'index')); ?>
$___viewFn = "G:\xampp\htdocs\cake_10\app\View\Users\index.ctp"
$___dataForView = array()
include - APP\View\users\index.ctp, line 1
View::_render() - CORE\Cake\View\View.php, line 595
View::render() - CORE\Cake\View\View.php, line 362
Controller::render() - CORE\Cake\Controller\Controller.php, line 900
Dispatcher::_invoke() - CORE\Cake\Routing\Dispatcher.php, line 111
Dispatcher::dispatch() - CORE\Cake\Routing\Dispatcher.php, line 86
[main] - APP\webroot\index.php, line 96
*Fatal error*: Call to a member function create() on a non-object in *
G:\xampp\htdocs\cake_10\app\View\users\index.ctp* on line *1
*ha estoy usando cakephp 2.0.6 haber si alguien me echa una mano*
*
--
Has recibido este mensaje porque estás suscrito al grupo "CakePHP-es" de Grupos
de Google.
Para ver este debate en la Web, visita
https://groups.google.com/d/msg/cakephp-es/-/XIBGtmOPhk0J.
Para publicar una entrada en este grupo, envía un correo electrónico a
[email protected].
Para anular tu suscripción a este grupo, envía un correo electrónico a
[email protected]
Para tener acceso a más opciones, visita el grupo en
http://groups.google.com/group/cakephp-es?hl=es.