本文整理汇总了PHP中yii\widgets\ListView::init方法的典型用法代码示例。如果您正苦于以下问题:PHP ListView::init方法的具体用法?PHP ListView::init怎么用?PHP ListView::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\widgets\ListView
的用法示例。
在下文中一共展示了ListView::init方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
parent::init();
$this->options['class'] .= ' row component component-resource-list';
$this->itemOptions['tag'] = false;
$this->summary = false;
}
示例2: init
public function init()
{
parent::init();
$LatLngCenter = new LatLng(['lat' => $this->centerPoint['lat'], 'lng' => $this->centerPoint['lng']]);
$this->map = new Map(['zoom' => $this->zoom, 'center' => $LatLngCenter, 'width' => '100%']);
$this->initMarkers();
$this->pushMarkers();
$this->flushMap();
}
示例3: init
public function init()
{
parent::init();
foreach (['url', 'srcNode'] as $property) {
if ($this->pluginOptions[$property] === null) {
throw new InvalidConfigException("The \"{$property}\" property must be set to \"pluginOptions\".");
}
}
Html::addCssStyle($this->itemOptions, ['display' => 'none']);
}
示例4: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
// 信息记录一般从尾页开始显示
$pagination = $this->dataProvider->getPagination();
$params = $pagination->params !== null ? $pagination->params : Yii::$app->getRequest()->getQueryParams();
if (!(isset($params[$pagination->pageParam]) && is_scalar($params[$pagination->pageParam]))) {
$pageSize = $pagination->getPageSize();
$totalCount = $this->dataProvider->getTotalCount();
$pagination->setPage((int) (($totalCount + $pageSize - 1) / $pageSize) - 1);
}
}
示例5: init
public function init()
{
parent::init();
$id = $this->getId();
$this->options['id'] = $id;
$classes = isset($this->options['class']) ? $this->options['class'] : '';
$classes .= ' sortable';
$this->options['class'] = trim($classes);
$view = $this->getView();
JuiAsset::register($view);
$url = Url::toRoute($this->orderUrl);
$sortOpts = array_merge($this->sortOptions, ['axis' => 'y', 'items' => '[data-key]', 'update' => new JsExpression("function(e, ui) {\n jQuery('#{$this->id}').addClass('sorting');\n jQuery.ajax({\n type: 'POST',\n url: '{$url}',\n data: {\n key: ui.item.data('key'),\n pos: ui.item.index('[data-key]')\n },\n complete: function() {\n jQuery('#{$this->id}').removeClass('sorting');\n }\n });\n }")]);
$sortJson = Json::encode($sortOpts);
$view->registerJs("jQuery('#{$id}').sortable({$sortJson});");
}
示例6: init
public function init()
{
parent::init();
$id = $this->getId();
if (isset($this->itemOptions['class'])) {
$this->itemOptions['class'] .= ' item';
} else {
$this->itemOptions['class'] = 'item';
}
if (isset($this->options['class'])) {
$this->options['class'] .= ' scroll-block-view clearfix';
} else {
$this->options['class'] = 'scroll-block-view clearfix';
}
if (!isset($this->options['id'])) {
$this->options['id'] = $id;
}
$this->wallOptions['container'] = new JsExpression("\$('#{$id}')");
if ($this->columns) {
$wallOptions['itemwidth'] = 100 / $this->columns . '%';
}
}
示例7: init
/**
* Inits widget
*/
public function init()
{
parent::init();
$this->initSortable();
}
示例8: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
$this->_date = null;
$this->layout = "{items}\n{pager}";
}
示例9: init
public function init()
{
parent::init();
$this->pager['class'] = LinkPager::className();
}
示例10: init
public function init()
{
parent::init();
$this->initDefaultButtons();
}
示例11: init
public function init()
{
parent::init();
$this->registerTranslations();
$this->initOptions();
}
示例12: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
$this->initOptions();
}
示例13: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
$this->_handler = new Intercooler($this->intercooler);
$this->initListOptions();
}