[SOLVED] CController and Components

Hello, below my codes:

protected/components/controller.php


<?php

class Controller extends CController {

	public $foo = null;


	public function init() {

		$this->foo = 'bar';

	}

}

protected/components/bar.php


<?php

class Bar extends CApplicationComponent {

	public function init() {

		echo($this->foo);

	}



What I want? Want to get property from base controller to use inside my components…

Sorry for my poor English, I`m braziliam.

I think u can access it like this




echo Yii::app()->controller->foo;



Thanks!

The problem is


<?php

class Bar extends CApplicationComponent {

[..]

 echo($this->foo);

which are expecting the "foo" propery from "CApplicationComponent", and not from "Controller".

SOLVED!