本文整理汇总了PHP中yii\bootstrap\Widget::run方法的典型用法代码示例。如果您正苦于以下问题:PHP Widget::run方法的具体用法?PHP Widget::run怎么用?PHP Widget::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\bootstrap\Widget
的用法示例。
在下文中一共展示了Widget::run方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Runs the widget
*/
public function run()
{
parent::run();
if ($this->useSessionFlash) {
$this->renderFlashAlerts();
} else {
$this->renderAlerts();
}
echo "\n" . Html::endTag('div');
}
示例2: run
public function run()
{
parent::run();
if ($this->options !== null) {
$tag = ArrayHelper::remove($this->options, 'tag', 'div');
$options = ArrayHelper::merge(['id' => $this->id], $this->options);
echo Html::tag($tag, '', $options);
$this->clientOptions['chart']['renderTo'] = $this->id;
}
$this->registerClientScripts();
}
示例3: run
public function run()
{
parent::run();
if ($this->useFlash) {
$this->_renderWithSession();
} else {
if (!isset($this->jsOptions['type']) || !isset($this->jsOptions['text'])) {
throw new InvalidConfigException('`type` and `text` must be set. please check it.');
}
$this->_renderDirect();
}
}
示例4: run
/**
* @inheritdoc
*/
public function run()
{
echo Html::beginTag('div', $this->options);
echo Html::tag('div', Html::tag('h3', $this->header) . Html::tag('p', $this->text), ['class' => 'inner']);
if (!empty($this->icon)) {
echo Html::tag('div', new Icon($this->icon), ['class' => 'icon']);
}
if (!empty($this->linkLabel)) {
echo Html::a($this->linkLabel, $this->linkRoute, ['class' => 'small-box-footer']);
}
echo Html::endTag('div');
parent::run();
}
示例5: run
public function run()
{
parent::run();
$limit_ad = FConfigParam::find()->where(['name' => 'NUMBER_AD_IN_BODY'])->one();
if ($limit_ad) {
$limit = $limit_ad->value;
} else {
$limit = 3;
}
$query = FAdvertise::find()->where(['is_show' => 1, 'position' => 'body', 'show_in' => $this->lan_center])->andwhere(['<=', 'start_at', new Expression('NOW()')])->andwhere(['>=', 'end_at', new Expression('NOW()')]);
$advertise = $query->limit($limit)->all();
return $this->render('@frontend/views/widgets/banner', ['advertises' => $advertise]);
}
示例6: run
public function run()
{
parent::run();
$limit_Lang_most = FConfigParam::find()->where(['name' => 'NUMBER_LANGUE_IN_MOST'])->one();
if ($limit_Lang_most) {
$limit = $limit_Lang_most->value;
} else {
$limit = 10;
}
$query = FLanguecenter::find()->where(['is_show' => 1])->orderBy('number DESC');
$mostViewlangs = $query->limit($limit)->all();
return $this->render('@frontend/views/widgets/mostView', ['mostViewlangs' => $mostViewlangs]);
}
示例7: run
public function run()
{
parent::run();
$limit_ad = FConfigParam::find()->where(['name' => 'NUMBER_IMAGE_TOP'])->one();
if ($limit_ad) {
$limit = $limit_ad->value;
} else {
$limit = 3;
}
$query = FAdvertise::find()->where(['is_show' => 1, 'position' => 'top', 'type' => 'image', 'show_in' => $this->lan_center]);
$advertise = $query->limit($limit)->all();
$banner = null;
if (!$advertise) {
$query1 = FAdvertise::find()->where(['is_show' => 1, 'position' => 'top', 'type' => 'image', 'show_in' => null]);
$banner = $query1->one();
//print_r($banner);
//die('hello');
}
return $this->render('@frontend/views/widgets/bannertop', ['advertises' => $advertise, 'banner' => $banner]);
}
示例8: run
public function run()
{
parent::run();
$content = Html::submitButton($this->model->isNewRecord ? self::t('messages', 'Create') : self::t('messages', 'Update'), ['class' => $this->model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
$jsCreateClose = <<<JS
var action = \$(this).parents('form').attr('action');
var submitButton = \$(this).parent().find('button[type=submit]');
\$(this).parents('form').attr('action', action + '&close=true');
submitButton.click();
return false;
JS;
$content .= ' ' . Html::a($this->model->isNewRecord ? self::t('messages', 'Create and close') : self::t('messages', 'Update and close'), '#', ['class' => 'btn btn-default btn-sm', 'onclick' => $jsCreateClose]);
$returnUrl = null;
if (\Yii::$app->controller->defaultAction === null) {
$returnUrl = \Yii::$app->user->returnUrl;
} else {
$returnUrl = [\Yii::$app->controller->defaultAction];
}
$content .= ' ' . Html::a(self::t('messages', 'Close'), $returnUrl, ['class' => 'btn btn-default btn-sm']);
$content = Html::tag('div', $content, ['class' => 'col-sm-8']) . Html::tag('div', $this->getInfoRecord(), ['class' => 'col-sm-4 text-right']);
return Html::tag('div', $content, ['class' => 'form-group well row']);
}
示例9: run
/**
* Output collected content
* @return string
*/
public function run()
{
parent::run();
return $this->content;
}
示例10: run
public function run()
{
parent::run();
return $this->render('@frontend/views/widget/cropImg', ['btn_name' => $this->btn_name]);
}
示例11: run
public function run()
{
parent::run();
return $this->render('//site/login');
}
示例12: run
/**
* @inheritdoc
*/
public function run()
{
echo Html::endTag('div');
echo Html::endTag('div');
parent::run();
}
示例13: run
/**
* @inheritdoc
*/
public function run()
{
parent::run();
echo $this->getGridOutput();
}
示例14: run
public function run()
{
parent::run();
}
示例15: run
/**
* @inheritdoc
*/
public function run()
{
echo Html::tag('div', '', ['id' => $this->options['id']]);
$this->registerAssets();
parent::run();
}