コード例 #1
0
ファイル: Controller.php プロジェクト: cookyii/project
 /**
  * @inheritdoc
  * @throws \yii\web\ForbiddenHttpException
  */
 public function init()
 {
     parent::init();
     $this->on(self::EVENT_BEFORE_ACTION, function (\yii\base\ActionEvent $ActionEvent) {
         $Action = $ActionEvent->action;
         if (!User()->isGuest && !in_array($Action->getUniqueId(), ['site/error'], true)) {
             $Account = Account();
             if (($reason = $Account->isAvailable()) !== true) {
                 switch ($reason) {
                     case 'not-activated':
                         throw new \yii\web\ForbiddenHttpException('You account is not activated.');
                     case 'deleted':
                         throw new \yii\web\ForbiddenHttpException('You account removed.');
                 }
             }
         }
     });
 }
コード例 #2
0
ファイル: Serializer.php プロジェクト: vicenteguerra/Flashbuy
 public function DeserializeClass($xmlString)
 {
     $Xml = simplexml_load_string($xmlString, Account());
     return $this->Deserialize($Xml);
 }
コード例 #3
0
ファイル: main.php プロジェクト: cookyii/project
<?php

/**
 * main.php
 * @author Revin Roman
 * @link https://rmrevin.com
 *
 * @var yii\web\View $this
 * @var string $content
 */
use yii\helpers\Html;
$Account = Account();
$this->beginContent('@app/views/layouts/_layout.php', ['content' => $content]);
$letters = array_map(function ($val) {
    return mb_substr($val, 0, 1, 'utf-8');
}, explode(' ', APP_NAME));
$menu_items = (include __DIR__ . '/_menu.php');
?>
    <header class="main-header">
        <!-- Logo -->
        <a href="/" class="logo">
            <!-- mini logo for sidebar mini 50x50 pixels -->
            <span class="logo-mini"><?php 
echo implode('', $letters);
?>
</span>
            <span class="logo-lg"><?php 
echo APP_NAME;
?>
</span>
        </a>