<?php

namespace app\blog\controller;

use app\common\controller\Frontend;
use think\Db;

class Index extends Frontend {

//    protected $layout = 'default';

    protected $noNeedLogin = '*';

    public function _initialize() {
        parent::_initialize(); // TODO: Change the autogenerated stub

        if(!$this->request->isPjax()){
//            $this->pjaxLayout();
//            $this->view->engine->layout('default/layout/layout_' . $this->layout);
        }

    }


    public function index() {

        $blog = db::name('blog')->whereNull('deletetime')->order('weigh desc, id desc')->paginate(10);

        $this->assign([
            'list' => $blog->items(),
            'paginate' => $blog->render()
        ]);
        return view();
    }





}
