예제 #1
0
 public function setTitle($title, $append = true)
 {
     $this->title = $title;
     if ($append == true) {
         $this->title .= '——' . CommonUtility::getCachedConfigValue('site_name');
     } else {
         if (is_string($append)) {
             $this->title .= $append;
         }
     }
 }
예제 #2
0
파일: main.php 프로젝트: tideit/yiicms
		<div class="clear"></div>
		
		<?php 
echo $content;
?>
	
	</div>
	<div class="clear"></div>
	<footer class="footer">
		<div class="container">
		<p class="pull-left">&copy; Malama.ca <?php 
echo date('Y');
?>
</p>
		<p class="pull-right"><?php 
echo Yii::powered();
?>
</p>
		</div>
	</footer>

	<?php 
echo CommonUtility::getCachedConfigValue('site_stats');
?>
	<?php 
$this->endBody();
?>
</body>
</html>
<?php 
$this->endPage();
예제 #3
0
<?php

use common\includes\CommonUtility;
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');
require __DIR__ . '/vendor/autoload.php';
require __DIR__ . '/vendor/yiisoft/yii2/Yii.php';
require __DIR__ . '/common/config/bootstrap.php';
require __DIR__ . '/frontend/config/bootstrap.php';
require __DIR__ . '/common/config/autoload.php';
$config = yii\helpers\ArrayHelper::merge(require __DIR__ . '/common/config/main.php', require __DIR__ . '/common/config/main-local.php', require __DIR__ . '/frontend/config/main.php', require __DIR__ . '/frontend/config/main-local.php');
$application = new yii\web\Application($config);
$application->language = 'zh-CN';
$siteStatus = CommonUtility::getCachedConfigValue('site_status');
if ($siteStatus === '0') {
    $application->catchAll = ['site/close', 'message' => 'test'];
}
$application->run();
예제 #4
0
 private function setSeo()
 {
     $view = LuLu::getView();
     $title = CommonUtility::getCachedConfigValue('seo_title');
     if (empty($title)) {
         $title = '首页——' . CommonUtility::getCachedConfigValue('seo_name');
     }
     $view->setTitle($title);
     $view->registerMetaTag(['name' => 'keywords', 'content' => CommonUtility::getCachedConfigValue('seo_keywords')]);
     $view->registerMetaTag(['name' => 'description', 'content' => CommonUtility::getCachedConfigValue('seo_description')]);
 }