本文整理汇总了PHP中CWidget::run方法的典型用法代码示例。如果您正苦于以下问题:PHP CWidget::run方法的具体用法?PHP CWidget::run怎么用?PHP CWidget::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CWidget
的用法示例。
在下文中一共展示了CWidget::run方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Run widget.
*/
public function run()
{
parent::run();
$this->htmlOptions['id'] = $this->map->id;
echo Html::tag($this->tagName, $this->htmlOptions, '');
$this->onAfterRender(new \CEvent($this));
}
示例2: run
/**
* Run the widget
*/
public function run()
{
$this->publishAssets();
$this->registerClientScripts();
$js = $this->createJsCode();
$this->clientScript->registerScript('jnotify_init', $js, CClientScript::POS_HEAD);
parent::run();
}
示例3: run
public function run()
{
parent::run();
$criteria = new CDbCriteria();
$criteria->order = 't.order ASC';
$menu = Menu::model()->findAll($criteria);
$this->render('home_menu_bar');
}
示例4: run
public function run()
{
/** @var $detector \Device */
$isMobile = Yii::app()->device->isDevice('mobile') ? true : false;
parent::run();
$model = new Place();
$this->render($this->view ? $this->view : 'default', ['model' => $model, 'mobile' => $isMobile]);
}
示例5: run
public function run()
{
parent::run();
$criteria = "(acos(sin({$this->newLat})*sin(radians(latitude)) + cos({$this->newLat})*cos(radians(latitude))*cos(radians(longitude)-({$this->newLng})))*{$this->radius})";
$limit = !empty($this->count) ? " LIMIT " . $this->count : "";
$command = Yii::app()->db->createCommand("SELECT *, " . $criteria . " AS 'distance' FROM transportStations WHERE " . $criteria . " <= " . $this->maxDistKm . " ORDER BY " . $criteria . $limit);
$transportStations = $command->queryAll();
$this->render($this->view ? $this->view : 'default', ['transportStations' => $transportStations, 'thisLatitude' => $this->lat, 'thisLongitude' => $this->lng, 'mapObject' => $this->mapObject, 'mapJourneyButton' => $this->mapJourneyButton, 'id' => $this->id]);
}
示例6: run
public function run()
{
parent::run();
$criteria = new CDbCriteria();
$criteria->order = 't.order ASC';
$menu = Menu::model()->findAll($criteria);
$data['adv'] = Advertisement::model()->findAll("state = 1");
$this->render('bottom_logos', $data);
}
示例7: run
public function run()
{
parent::run();
if ($this->dataProvider === null) {
throw new CException(Yii::t('ext.mobile', '"dataProvider" field must be set.'));
}
if ($this->itemView === null) {
throw new CException(Yii::t('ext.mobile', '"itemView" field must be set.'));
}
$this->render('body');
}
示例8: run
public function run()
{
$limit = NewsConfig::model()->findByPk(1, array('select' => 'widget_count'));
$limit = $limit->widget_count;
$criteria = new CDbCriteria();
$criteria->compare('public', 1);
$criteria->limit = $limit;
$criteria->order = 'date DESC';
$news = News::model()->findAll($criteria);
$this->render('lastnews', array('news' => $news));
return parent::run();
}
示例9: run
public function run()
{
$attribute = $this->attribute;
$idoftxtfield = get_class($this->model) . "_" . $this->attribute;
$idoftxtfield2 = get_class($this->model) . "DD" . $this->attribute;
$idofulmenu = get_class($this->model) . "-" . $this->attribute . "-ul";
$varname = $idoftxtfield . "js";
echo $this->form->hiddenField($this->model, $this->attribute);
echo $this->getul($this->data, " id='" . $idofulmenu . "' class='mcdropdown_menu'");
echo "\n\t\t<input type=\"text\" size=\"45\" value=\"" . $this->model->{$attribute} . "\" id=\"" . $idoftxtfield2 . "\">\n\t\t<script type=\"text/javascript\">\n\t\tvar " . $varname . "=null;\n\t\t\$(document).ready(function (){\n\t\t\$('#" . $idoftxtfield2 . "').mcDropdown('#" . $idofulmenu . "',{allowParentSelect: true,select:function(){\n\t\t\$('#" . $idoftxtfield . "').val(" . $varname . ".getValue()[0]);\n\t}});\n\t" . $varname . "= \$('#" . $idoftxtfield2 . "').mcDropdown();\n\t});\n\n\t</script>";
parent::run();
}
示例10: run
/**
* @return void
*/
public function run()
{
parent::run();
// save & clean buffer
$content = ob_get_contents();
ob_end_clean();
if ($this->outputBuffer) {
echo EModal::$buffer;
} else {
EModal::$buffer .= $this->render('modal', array('id' => $this->id, 'content' => $content), true);
}
}
示例11: run
public function run()
{
// this method is called by CController::endWidget()
$this->publishAssets();
$this->registerClientScripts();
$this->htmlOptions['id'] = $this->getId();
echo "\n\n";
echo CHtml::openTag('div', $this->htmlOptions) . "\n";
echo 'The chart will appear within this DIV. This text will be replaced by the chart.' . "\n";
echo CHtml::closeTag('div');
// $this->renderChart();
parent::run();
echo "\n<!-- Fusion Chart " . $this->getId() . " -->\n";
}
示例12: run
public function run()
{
parent::run();
$js = '';
if (isset($this->watchElement)) {
$js .= "\$('{$this->watchElement}').one('change', function() {";
}
$js .= "\$(window).bind('beforeunload', function() {\r\r\n return \"" . $this->message . "\" ;\r\r\n });";
$js .= "\$('input[type=\"submit\"]').bind('click', function(){\r\r\n window.onbeforeunload = function(){};\r\r\n \$(window).unbind('beforeunload');\r\r\n });";
if (isset($this->watchElement)) {
$js .= "});";
}
Yii::app()->clientScript->registerCoreScript('jquery');
Yii::app()->clientScript->registerScript($this->getId(), $js, CClientScript::POS_READY);
}
示例13: run
public function run()
{
$galleryConfig = GalleryConfig::model()->find();
$displayMode = $galleryConfig->display_mode;
switch ($displayMode) {
case 0:
$gallery = Gallery::getFirstGallery();
break;
case 1:
$gallery = Gallery::getRandomGallery();
break;
case 2:
$gallery = Gallery::getSelectedGallery($galleryConfig->selected_gallery_id);
break;
}
$this->render('gallery', array('gallery' => $gallery));
return parent::run();
}
示例14: run
/**
* @method run
*/
public function run()
{
$reviewsConfig = ReviewsConfig::model()->find();
$criteria = new CDbCriteria();
$criteria->order = 'date_create DESC';
if ($reviewsConfig->premoder and Yii::app()->user->isGuest) {
$criteria->condition = 'public = :public';
$criteria->params = array(':public' => true);
}
$dataProvider = Reviews::model()->findAll($criteria);
/*
$dataProvider = new CActiveDataProvider('Reviews', array(
'criteria' => $criteria,
'pagination' => false,
));
*/
$this->render('reviews', array('dataProvider' => $dataProvider));
return parent::run();
}
示例15: run
public function run()
{
parent::run();
$model = new Deal();
$this->render($this->view ? $this->view : 'default', array('model' => $model, 'type' => $this->type, 'minPrices' => Util::getPropertyPrices("minimum"), 'maxPrices' => Util::getPropertyPrices("maximum"), 'isMobile' => Yii::app()->device->isDevice('mobile')));
}