Tutorial by Examples

We have a table that includes of countries so we create a model that called countrylist model <?php namespace app\models; use Yii; /** * This is the model class for table "countrylist". * * @property integer $id * @property string $iso * @property string $name * @p...
As an example you want to disable pagination in your default index action and get all results in index. How can you do that? It's simple. You should override the index action in your controller like this: public function actions() { $actions = parent::actions(); unset($actions['index'])...
Use case: just one action which should return a plain (text) content as-is: public function actionAsXML() { $this->layout = false; Yii::$app->response->format = Response::FORMAT_XML; return ['aaa' => [1, 2, 3, 4]];; } Pre-defined response formats are: FORMAT_HTM...

Page 1 of 1