Re: Undefined property: NewsMainsController::$modelClass [CORE\cake\libs\controller\controller.php, line 347]

2007-11-23 Thread FoxMaSk


 class AppController extends Controller {
   public function __construct() {
parent::__construct();
 }
}

solve the issue


On 23 nov, 17:36, FoxMaSk <[EMAIL PROTECTED]> wrote:
> Hi,
>
> i'm using cakephp 1.2.x.x
>
> i did cake bake to build all my Model View and Controller
>
> here is my model :
>  class NewsMain extends AppModel {
>
> var $name = 'NewsMain';
> var $useTable = 'news_main';
> var $validate = array(
> 'title' => VALID_NOT_EMPTY,
> 'url' => VALID_NOT_EMPTY,
> 'date' => VALID_NOT_EMPTY,
> 'status' => VALID_NOT_EMPTY,
> 'tid' => VALID_NOT_EMPTY,
> 'pid' => VALID_NOT_EMPTY,
> );
>
> //The Associations below have been created with all possible keys,
> those that are not needed can be removed
> var $belongsTo = array(
> 'NewsCat' => array('className' => 'Ne class NewsMain extends AppModel {
>
> public $name = 'NewsMain';
> public $useTable = 'news_main';
> public $validate = array(
> 'title' => VALID_NOT_EMPTY,
> 'url' => VALID_NOT_EMPTY,
> 'date' => VALID_NOT_EMPTY,
> 'status' => VALID_NOT_EMPTY,
> 'tid' => VALID_NOT_EMPTY,
> 'pid' => VALID_NOT_EMPTY,
> );
>
> //The Associations below have been created with all possible keys,
> those that are not needed can be removed
> public $belongsTo = array(
> 'NewsCat' => array('className' => 'NewsCat',
> 'foreignKey' 
> => 'cat_id',
> 'conditions' 
> => '',
> 'fields' => 
> '',
> 'order' => '',
> 
> 'counterCache' => ''),
> );
>
> public $hasMany = array(
> 'NewsVote' => array('className' => 'NewsVote',
> 'foreignKey' 
> => 'id_news',
> 'conditions' 
> => '',
> 'fields' => 
> '',
> 'order' => '',
> 'limit' => '',
> 'offset' => 
> '',
> 'dependent' 
> => '',
> 'exclusive' 
> => '',
> 'finderQuery' 
> => '',
> 
> 'counterQuery' => ''),
> );
>
> }
>
> ?>
>
> and the Controller :
>  class NewsMainsController extends AppController {
>
> public $name = 'NewsMains';
> public $helpers = array('Html', 'Form' );
>
> public function index() {
> $this->NewsMain->recursive = 0;
> $this->set('newsMains', $this->paginate());
> }
> [...]
>
> }?>
>
> and as soon as i want to add a __construct() in the
> app_controller.php  i get the error i posted.
>  /* SVN FILE: $Id: app_controller.php 5118 2007-05-18 17:19:53Z phpnut
> $ */
>
> [...]
> class AppController extends Controller {
>
> public function __construct() {
>
> }}
>
> ?>
>
> ps : i saw an old message here with the exactly same Undefined
> property ::$modelClass on the version 1.1.x.x
> anyone can explain me what's wrong here ?
>
> Kind Regards.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Undefined property: NewsMainsController::$modelClass [CORE\cake\libs\controller\controller.php, line 347]

2007-11-23 Thread FoxMaSk

Hi,

i'm using cakephp 1.2.x.x

i did cake bake to build all my Model View and Controller

here is my model :
 VALID_NOT_EMPTY,
'url' => VALID_NOT_EMPTY,
'date' => VALID_NOT_EMPTY,
'status' => VALID_NOT_EMPTY,
'tid' => VALID_NOT_EMPTY,
'pid' => VALID_NOT_EMPTY,
);

//The Associations below have been created with all possible keys,
those that are not needed can be removed
var $belongsTo = array(
'NewsCat' => array('className' => 'Ne VALID_NOT_EMPTY,
'url' => VALID_NOT_EMPTY,
'date' => VALID_NOT_EMPTY,
'status' => VALID_NOT_EMPTY,
'tid' => VALID_NOT_EMPTY,
'pid' => VALID_NOT_EMPTY,
);

//The Associations below have been created with all possible keys,
those that are not needed can be removed
public $belongsTo = array(
'NewsCat' => array('className' => 'NewsCat',
'foreignKey' => 
'cat_id',
'conditions' => 
'',
'fields' => '',
'order' => '',
'counterCache' 
=> ''),
);

public $hasMany = array(
'NewsVote' => array('className' => 'NewsVote',
'foreignKey' => 
'id_news',
'conditions' => 
'',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'dependent' => 
'',
'exclusive' => 
'',
'finderQuery' 
=> '',
'counterQuery' 
=> ''),
);

}
?>

and the Controller :
NewsMain->recursive = 0;
$this->set('newsMains', $this->paginate());
}
[...]
}?>

and as soon as i want to add a __construct() in the
app_controller.php  i get the error i posted.



ps : i saw an old message here with the exactly same Undefined
property ::$modelClass on the version 1.1.x.x
anyone can explain me what's wrong here ?

Kind Regards.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---