本文整理汇总了PHP中yii\base\Widget::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Widget::__construct方法的具体用法?PHP Widget::__construct怎么用?PHP Widget::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\base\Widget
的用法示例。
在下文中一共展示了Widget::__construct方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($config = [])
{
parent::__construct($config);
if (!$this->transaction instanceof OrderTransaction) {
$this->transaction = new OrderTransaction();
}
}
示例2: __construct
public function __construct($config = [])
{
//by default both opengraph and microdata are enabled, disable if ['enable' => false] was explicitly passed to widget
$config['og'] = array_merge($this->og, isset($config['og']) ? $config['og'] : []);
$config['md'] = array_merge($this->md, isset($config['md']) ? $config['md'] : []);
parent::__construct($config);
}
示例3: __construct
public function __construct($config = [])
{
$this->_config = $config;
try {
parent::__construct($config);
} catch (WidgetMissedIdException $e) {
throw $e;
} catch (\Exception $e) {
$this->processException($e);
}
}
示例4: __construct
public function __construct($config = [])
{
if (count($config) > 0) {
$this->action = empty($config['action']) ? \Yii::$app->controller->action->id : $config['action'];
$this->selector = empty($config['selector']) ? 'ctype' : $config['selector'];
$this->ctype = empty($config[$this->selector]) ? '' : $config[$this->selector];
} else {
$this->action = \Yii::$app->controller->action->id;
$this->ctype = !empty(\Yii::$app->getRequest()->getQueryParam($this->selector)) ? \Yii::$app->getRequest()->getQueryParam($this->selector) : 'page';
}
parent::__construct();
// TODO: Change the autogenerated stub
}
示例5: __construct
public function __construct(BuildingFinderInterface $buildingFinder, $config = [])
{
$this->buildingFinder = $buildingFinder;
parent::__construct($config);
}
示例6: __construct
public function __construct(BlogFinder $finder, $config = [])
{
$this->finder = $finder;
parent::__construct($config);
}