Yii Framework Forum: CController and Controller - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

CController and Controller What is the difference between CController and Controller? Rate Topic: -----

#1 User is offline   adhysh 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 03-July 10

Posted 09 July 2010 - 09:29 PM

Hi,

I've just started to learn Yii and follow "Where to Start with Yii" tutorial and got stuck on CController.
when i run code:
class MessageController extends CController
{
public function actionIndex()
{
$this->render('index');
}
)

It's show exception:
CException
Description

Property "MessageController.breadcrumbs" is not defined.
Source File

C:\DevEnv\wamp\www\lab\protected\views\message\index.php(2)

But when i change the "extends CController" to "extends Controller"
it was successfully show the proper page.

Please help ...

thanksss
0

#2 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,857
  • Joined: 04-October 08
  • Location:DC, USA

Posted 09 July 2010 - 10:09 PM

The breadcrumbs property is defined in the customized base class Controller, which is located in your application's protected/components directory.
0

#3 User is offline   adhysh 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 03-July 10

Posted 10 July 2010 - 06:43 AM

View Postqiang, on 09 July 2010 - 10:09 PM, said:

The breadcrumbs property is defined in the customized base class Controller, which is located in your application's protected/components directory.


Thanks Qiang,
I understand now that Controller is a child of CController,
and actually MessageController can derive directly from CController with the same property definition as Controller.

Rgrds,
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users