37 lines
598 B
PHP
37 lines
598 B
PHP
<?php
|
|
|
|
namespace app\controllers;
|
|
|
|
use Yii;
|
|
use yii\web\Controller;
|
|
use yii\helpers\Url;
|
|
|
|
class SiteController extends Controller
|
|
{
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function actions()
|
|
{
|
|
return [
|
|
'error' => [
|
|
'class' => 'yii\web\ErrorAction',
|
|
],
|
|
];
|
|
}
|
|
|
|
public function actionIndex()
|
|
{
|
|
$cameras = [];
|
|
foreach (Yii::$app->params['cameras'] as $id => $zm_id)
|
|
{
|
|
$cameras[$id] = Url::to(['camera/stream', 'id' => $id]);
|
|
}
|
|
return $this->render('index',
|
|
[
|
|
'cameras' => $cameras
|
|
]);
|
|
}
|
|
}
|