i have problem with cakephp when i call controller class with a model
from another controller , it look like the model didn't map in to that
class i called
here is my code :
-----------------------------------------------------------------------------------
model : vo.php
<?php
class Vo extends AppModel {
var $name = 'Vo';
}
?>
------------------------------------------------------------------------------------------------------
controller : vos_controller.php
class VosController extends AppController{
var $name = "Vo";
function doSomeThing(){
return $this->Vo->findAll();
}
}
------------------------------------------------------------------------------------------------------
second controller that call first controller : guis_controller.php
<?php
class GuisController extends AppController{
var $uses = array();
function beforeFilter(){
include("vos_controller.php");
}
function display(){
$vosController = new VosController();
$list = $vosController->doSomeThing();
var_dump($list);
}
}
?>
----------------------------------------------------------------------------------
and i got Undefined property: VosController::$Vo and Fatal error: Call
to a member function query() on a non-object problem . It look like
the model Vo didn't map in to VosController class.Also i try call
doSomeThing() method from VosController directly and everything work
fine.
thank for your help.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---