1 | <?php |
||
2 | |||
3 | namespace backend\controllers; |
||
4 | |||
5 | use Yii; |
||
6 | use backend\models\Log; |
||
7 | use backend\models\search\LogSearch; |
||
8 | use backend\components\Controller; |
||
9 | use yii\web\NotFoundHttpException; |
||
10 | use yii\filters\VerbFilter; |
||
11 | |||
12 | /** |
||
13 | * LogsController implements the CRUD actions for Log model. |
||
14 | */ |
||
15 | class LogsController extends Controller |
||
16 | { |
||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $modelClass = Log::class; |
||
21 | |||
22 | /** |
||
23 | * @inheritdoc |
||
24 | */ |
||
25 | public function behaviors() |
||
26 | { |
||
27 | return [ |
||
28 | 'verbs' => [ |
||
29 | 'class' => VerbFilter::className(), |
||
0 ignored issues
–
show
|
|||
30 | 'actions' => [ |
||
31 | 'delete' => ['POST'], |
||
32 | ], |
||
33 | ], |
||
34 | ]; |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * Lists all Log models. |
||
39 | * @return mixed |
||
40 | */ |
||
41 | public function actionIndex() |
||
42 | { |
||
43 | $searchModel = new LogSearch(); |
||
44 | $dataProvider = $searchModel->search(Yii::$app->request->queryParams); |
||
45 | |||
46 | return $this->render('index', [ |
||
47 | 'searchModel' => $searchModel, |
||
48 | 'dataProvider' => $dataProvider, |
||
49 | ]); |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * Displays a single Log model. |
||
54 | * @param integer $id |
||
55 | * @return mixed |
||
56 | * @throws NotFoundHttpException if the model cannot be found |
||
57 | */ |
||
58 | public function actionView($id) |
||
59 | { |
||
60 | return $this->render('view', [ |
||
61 | 'model' => $this->findModel($id), |
||
62 | ]); |
||
63 | } |
||
64 | |||
65 | /** |
||
66 | * @inheritdoc |
||
67 | */ |
||
68 | public function render($view, $params = []) |
||
69 | { |
||
70 | return parent::render($view, $params + [ |
||
71 | 'itemTypes' => Log::listItemTypes(), |
||
72 | ]); |
||
73 | } |
||
74 | } |
||
75 |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.