setPaginator() 공개 메소드

Set the pagination environment instance.
public setPaginator ( Illuminate\Pagination\Environment | Closure $paginator ) : void
$paginator Illuminate\Pagination\Environment | Closure
리턴 void
예제 #1
0
 /**
  * Prepare the database connection instance.
  *
  * @param  Illuminate\Database\Connection  $connection
  * @return Illuminate\Database\Connection
  */
 protected function prepare(Connection $connection)
 {
     $connection->setEventDispatcher($this->app['events']);
     // We will setup a Closure to resolve the paginator instance on the connection
     // since the Paginator isn't sued on every request and needs quite a few of
     // our dependencies. It'll be more efficient to lazily resolve instances.
     $app = $this->app;
     $connection->setPaginator(function () use($app) {
         return $app['paginator'];
     });
     return $connection;
 }
예제 #2
0
 /**
  * Prepare the database connection instance.
  *
  * @param  \LMongo\Connection  $connection
  * @return \LMongo\Connection
  */
 protected function prepare(Connection $connection)
 {
     if ($this->app->bound('events')) {
         $connection->setEventDispatcher($this->app['events']);
     }
     // The database connection can also utilize a cache manager instance when cache
     // functionality is used on queries, which provides an expressive interface
     // to caching both fluent queries and Eloquent queries that are executed.
     $app = $this->app;
     $connection->setCacheManager(function () use($app) {
         return $app['cache'];
     });
     // We will setup a Closure to resolve the paginator instance on the connection
     // since the Paginator isn't sued on every request and needs quite a few of
     // our dependencies. It'll be more efficient to lazily resolve instances.
     $connection->setPaginator(function () use($app) {
         return $app['paginator'];
     });
     return $connection;
 }