コード例 #1
0
 /**
  * Initializes the pager.
  */
 public function init()
 {
     parent::init();
     // Register translations source
     Yii::$app->i18n->translations = ArrayHelper::merge(Yii::$app->i18n->translations, ['kop\\y2sp' => ['class' => PhpMessageSource::className(), 'basePath' => '@vendor/kop/yii2-scroll-pager/messages', 'fileMap' => ['kop\\y2sp' => 'general.php']]]);
     // Register required assets
     InfiniteAjaxScrollAsset::register($this->view);
     // Set default trigger text if not set
     if ($this->triggerText === null) {
         $this->triggerText = Yii::t('kop\\y2sp', 'Load more items');
     }
     // Set default "none left" message text if not set
     if ($this->noneLeftText === null) {
         $this->noneLeftText = Yii::t('kop\\y2sp', 'You reached the end');
     }
 }
コード例 #2
0
 /**
  * Register required asset bundles.
  *
  * You can override this method in case if you want to use your own JQuery Infinite Ajax Scroll plugin files
  * (for example, some forked plugin version).
  */
 protected function registerAssets()
 {
     InfiniteAjaxScrollAsset::register($this->view);
 }