mirror of
https://github.com/yiisoft/yii.git
synced 2026-03-03 23:04:04 +01:00
42 lines
686 B
PHP
42 lines
686 B
PHP
<?php
|
|
class NewComponent extends CComponent
|
|
{
|
|
private $_object = null;
|
|
private $_text = 'default';
|
|
public $eventHandled = false;
|
|
public $behaviorCalled = false;
|
|
|
|
public function getText()
|
|
{
|
|
return $this->_text;
|
|
}
|
|
|
|
public function setText($value)
|
|
{
|
|
$this->_text=$value;
|
|
}
|
|
|
|
public function getObject()
|
|
{
|
|
if(!$this->_object)
|
|
{
|
|
$this->_object=new NewComponent;
|
|
$this->_object->_text='object text';
|
|
}
|
|
return $this->_object;
|
|
}
|
|
|
|
public function onMyEvent()
|
|
{
|
|
$this->raiseEvent('OnMyEvent',new CEvent($this));
|
|
}
|
|
|
|
public function myEventHandler($event)
|
|
{
|
|
$this->eventHandled=true;
|
|
}
|
|
public function exprEvaluator($p1,$comp) {
|
|
return "Hello $p1";
|
|
}
|
|
}
|