Example #1
0
 public function actionIndex()
 {
     $setting = new Setting();
     $data['siteName'] = $setting->getSiteName()->value;
     $data['address'] = $setting->getAddress()->value;
     $data['nickName'] = $setting->getNickName()->value;
     $data['desc'] = $setting->getDesc()->value;
     return $this->render('index', ['info' => $data]);
 }
Example #2
0
use app\assets\AppAsset;
use app\models\Menu;
use app\models\Setting;
use app\models\Article;
use yii\helpers\Url;
AppAsset::register($this);
$menu = new Menu();
$tags = $menu->getTags();
$all = 0;
foreach ($tags as $tag) {
    $all += $tag['num'];
}
$average = $all / count($tags);
$list = $menu->getMenuList();
$setting = new Setting();
$siteName = $setting->getSiteName()->value;
$this->beginPage();
?>
<!DOCTYPE html>
<html lang="<?php 
echo Yii::$app->language;
?>
">
<head>
    <meta charset="<?php 
echo Yii::$app->charset;
?>
">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?php 
echo Html::csrfMetaTags();