本文整理汇总了PHP中yii\base\Behavior::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Behavior::__construct方法的具体用法?PHP Behavior::__construct怎么用?PHP Behavior::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\base\Behavior
的用法示例。
在下文中一共展示了Behavior::__construct方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
if (empty($this->id)) {
$this->id = strtolower((new \ReflectionClass($this))->getShortName());
}
if (empty($this->label)) {
$this->id = (new \ReflectionClass($this))->getShortName();
}
parent::__construct();
}
示例2: __construct
public function __construct($config = [])
{
parent::__construct($config);
register_shutdown_function(function () {
if ($this->_promises) {
if (function_exists('\\fastcgi_finish_request')) {
\fastcgi_finish_request();
}
P\inspect_all($this->_promises);
}
});
}
示例3: __construct
/**
* CreateImageBehavior constructor.
* @param BaseName $name name generator
* @param CreateImageInterface $imageCreator image resizer
* @param array $config
*/
public function __construct(BaseName $name, CreateImageInterface $imageCreator, $config = array())
{
parent::__construct($config);
$this->name = $name;
$this->imageCreator = $imageCreator;
}
示例4: __construct
/**
* Instance constructor.
*
* @param array $config
*/
public function __construct($config = [])
{
if (array_key_exists('defaultWorkflowId', $config)) {
if (is_string($config['defaultWorkflowId'])) {
$this->_defaultWorkflowId = $config['defaultWorkflowId'];
} else {
throw new InvalidConfigException("Invalid property Type : 'defaultWorkflowId' must be a string");
}
unset($config['defaultWorkflowId']);
}
parent::__construct($config);
}
示例5:
function __construct()
{
parent::__construct();
self::checkImageDir();
}