Initable.php 947 Bytes
Newer Older
w  
Qiang Xue committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<?php
/**
 * Initable interface file.
 *
 * @link http://www.yiiframework.com/
 * @copyright Copyright &copy; 2008-2012 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

namespace yii\base;

/**
 * Initable is an interface indicating a class needs initialization to work properly.
 *
Qiang Xue committed
15 16 17
 * Initable requires a class to implement the [[init()]] method.
 * When [[\Yii::createObject()]] is being used to create a new component which implements
 * Initable, it will call the [[init()]] method after setting the initial values of the
w  
Qiang Xue committed
18
 * component properties.
w  
Qiang Xue committed
19 20 21 22 23 24 25 26
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @since 2.0
 */
interface Initable
{
	/**
	 * Initializes this component.
Qiang Xue committed
27
	 * This method is invoked by [[\Yii::createObject]] after its creates the new
w  
Qiang Xue committed
28 29 30 31 32
	 * component instance and initializes the component properties. In other words,
	 * at this stage, the component has been fully configured.
	 */
	public function init();
}