本文整理匯總了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);
}