PerformerController.php 2.3 KB
<?php
namespace frontend\controllers;

use common\models\Fields;
use common\widgets\FieldEditor;
use Yii;
use common\models\LoginForm;
use frontend\models\PasswordResetRequestForm;
use frontend\models\ResetPasswordForm;
use frontend\models\SignupForm;
use frontend\models\ContactForm;
use frontend\models\Options;
use frontend\models\OptionValues;
use yii\base\InvalidParamException;
use yii\web\BadRequestHttpException;
use yii\web\Controller;
use yii\filters\VerbFilter;
use yii\filters\AccessControl;
use frontend\models\OptionsToValues;
use yii\validators\EmailValidator;
use common\models\User;
use yii\helpers\VarDumper;
use common\models\Page; 
use frontend\models\Option;
use common\models\Social;


/**
 * Site controller
 */
class PerformerController extends Controller
{
    public $layout = 'performer';

    /**
     * @inheritdoc
     */
    public function actions()
    {
        return [
            'error' => [
                'class' => 'yii\web\ErrorAction',
            ],
            'captcha' => [
                'class' => 'yii\captcha\CaptchaAction',
                'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null,
            ],
        ];
    }

    /**
     * @var $user common\models\User
     */
    public function actionIndex()
    {
        $user = \Yii::$app->user->identity;

        $education = Fields::getData($user->id,$user::className(),'education');

        return $this->render('common',[
            'user' => \Yii::$app->user->identity,
            '$education' => $education
        ]);
    }

    public function actionCommon(/*$performer_id*/)
    {
        return $this->render('common');
    }

    public function actionPortfolio(/*$performer_id*/)
    {
        return $this->render('portfolio');
    }

    public function actionBlogList(/*$performer_id*/)
    {
        return $this->render('blog-list');
    }

    public function actionBlogView(/*$performer_id, $article_id*/)
    {
        return $this->render('blog-view');
    }

    public function actionReview(/*$performer_id*/)
    {
        return $this->render('review');
    }

    public function actionWorkplace(/*$performer_id*/)
    {
        return $this->render('workplace');
    }

    public function actionGallery(/*$performer_id*/)
    {
        $this->layout = 'gallery';
        return $this->render('gallery');
    }
}