public function actionIndex() { $this->checkLogin(); $this->layout = 'admin'; $modelOrder = new Order(); $orders = $modelOrder->getAll(); return $this->render('index', ['orders' => $orders]); }
public function actionTest() { $orders = Order::getAll(); return $this->render("test", ["orders" => $orders]); }
<?php /* @var $this yii\web\View */ use app\models\Order; use yii\data\ArrayDataProvider; use yii\widgets\ListView; $this->title = 'Заказы'; $this->params['breadcrumbs'][] = $this->title; ?> <div class="site-about"> <h1>Заказы</h1> <?php $dataProvider = new ArrayDataProvider(['allModels' => Order::getAll(), 'pagination' => ['pageSize' => 20]]); echo ListView::widget(['dataProvider' => $dataProvider, 'itemView' => '_post']); ?> </div>
public function actionIndex() { $orders = Order::getAll(); return $this->render('index', ['orders' => $orders]); }