Example #1
0
*/
include ROOT_PATH . '/vendor/autoload.php';
date_default_timezone_set(config('app', 'timezone'));
include ROOT_PATH . '/core/bootstrap/eloquent.php';
include ROOT_PATH . '/core/migrations.php';
include ROOT_PATH . '/core/validator.php';
include ROOT_PATH . '/core/middleware.php';
session_start();
App\Classes\Validator::renamed(config('validator', 'attributes'));
App\Classes\Validator::setMessages(config('validator', 'messages'));
/**
* Make sure the paginator has somewhere to grab 
* pages from
*/
Illuminate\Pagination\Paginator::currentPageResolver(function () {
    return isset($_GET['page']) ? $_GET['page'] : false;
});
// Boot the Application
$app = new App\Classes\Application();
$app->boot();
/*
|--------------------------------------------------------------------------
| Other includes
|--------------------------------------------------------------------------
|
| .....
|
*/
include DISTRO_PATH . config('app', 'distro_version') . '/helpers.php';
include DISTRO_PATH . config('app', 'distro_version') . '/post-requests/requests.php';
if (file_exists(theme('plugin/index.php'))) {
/**
 * 拓展分页输出,支持临时指定分页模板
 * @param  Illuminate\Pagination\Paginator  $paginator  分页查询结果的最终实例
 * @param  string                           $viewName   分页视图名称
 * @return \Illuminate\View\View
 */
function pagination(Illuminate\Pagination\Paginator $paginator, $viewName = null)
{
    $viewName = $viewName ?: Config::get('view.pagination');
    $paginator->getEnvironment()->setViewName($viewName);
    return $paginator->links();
}
 /**
  * Create a pagination slider link.
  *
  * @param  mixed   $page
  * @return string
  */
 public function getLink($page)
 {
     $url = $this->paginator->getUrl($page);
     return '<li><a href="' . $url . '">' . $page . '</a></li>';
 }