diff --git a/README.md b/README.md index 52af522..1cd0121 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,10 @@ If you are looking for a production-ready PHP framework, please use Yii 2.0 is still under heavy development. We may make significant changes without prior notices. **Yii 2.0 is not ready for production use yet.** -[![Build Status](https://secure.travis-ci.org/yiisoft/yii2.png)](http://travis-ci.org/yiisoft/yii2) [![Dependency Status](https://www.versioneye.com/php/yiisoft:yii2/dev-master/badge.png)](https://www.versioneye.com/php/yiisoft:yii2/dev-master) +[![Latest Stable Version](https://poser.pugx.org/yiisoft/yii2/v/stable.png)](https://packagist.org/packages/yiisoft/yii2) +[![Total Downloads](https://poser.pugx.org/yiisoft/yii2/downloads.png)](https://packagist.org/packages/yiisoft/yii2) +[![Build Status](https://secure.travis-ci.org/yiisoft/yii2.png)](http://travis-ci.org/yiisoft/yii2) +[![Dependency Status](https://www.versioneye.com/php/yiisoft:yii2/dev-master/badge.png)](https://www.versioneye.com/php/yiisoft:yii2/dev-master) DIRECTORY STRUCTURE diff --git a/apps/advanced/backend/config/AppAsset.php b/apps/advanced/backend/config/AppAsset.php index 944807a..267e48c 100644 --- a/apps/advanced/backend/config/AppAsset.php +++ b/apps/advanced/backend/config/AppAsset.php @@ -6,6 +6,7 @@ */ namespace backend\config; + use yii\web\AssetBundle; /** @@ -23,6 +24,6 @@ class AppAsset extends AssetBundle ); public $depends = array( 'yii\web\YiiAsset', - 'yii\bootstrap\ResponsiveAsset', + 'yii\bootstrap\BootstrapAsset', ); } diff --git a/apps/advanced/backend/config/params.php b/apps/advanced/backend/config/params.php index 1e197d0..1643a70 100644 --- a/apps/advanced/backend/config/params.php +++ b/apps/advanced/backend/config/params.php @@ -1,5 +1,4 @@ 'admin@example.com', -); \ No newline at end of file +); diff --git a/apps/advanced/backend/controllers/SiteController.php b/apps/advanced/backend/controllers/SiteController.php index 09052d2..480406a 100644 --- a/apps/advanced/backend/controllers/SiteController.php +++ b/apps/advanced/backend/controllers/SiteController.php @@ -17,7 +17,7 @@ class SiteController extends Controller { $model = new LoginForm(); if ($model->load($_POST) && $model->login()) { - return $this->redirect(array('site/index')); + return $this->goHome(); } else { return $this->render('login', array( 'model' => $model, @@ -28,6 +28,6 @@ class SiteController extends Controller public function actionLogout() { Yii::$app->user->logout(); - return $this->redirect(array('site/index')); + return $this->goHome(); } } diff --git a/apps/advanced/backend/views/layouts/main.php b/apps/advanced/backend/views/layouts/main.php index 9f66a11..36f4645 100644 --- a/apps/advanced/backend/views/layouts/main.php +++ b/apps/advanced/backend/views/layouts/main.php @@ -1,7 +1,8 @@ head(); ?> -
beginBody(); ?> -
-

My Company

- - - -
+ 'My Company', + 'brandUrl' => Yii::$app->homeUrl, + 'options' => array( + 'class' => 'navbar-inverse navbar-fixed-top', + ), + )); + $menuItems = array( + array('label' => 'Home', 'url' => array('/site/index')), + ); + if (Yii::$app->user->isGuest) { + $menuItems[] = array('label' => 'Login', 'url' => array('/site/login')); + } else { + $menuItems[] = array('label' => 'Logout (' . Yii::$app->user->identity->username .')' , 'url' => array('/site/logout')); + } + echo Nav::widget(array( + 'options' => array('class' => 'navbar-nav pull-right'), + 'items' => $menuItems, + )); + NavBar::end(); + ?> +
isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : array(), )); ?> +
-
+ - endBody(); ?> -
endPage(); ?> diff --git a/apps/advanced/backend/views/site/index.php b/apps/advanced/backend/views/site/index.php index 158b61c..bc084da 100644 --- a/apps/advanced/backend/views/site/index.php +++ b/apps/advanced/backend/views/site/index.php @@ -2,46 +2,52 @@ /** * @var yii\base\View $this */ -$this->title = 'Welcome'; +$this->title = 'My Yii Application'; ?> -
-

Welcome!

+
-

Cras justo odio, dapibus ac facilisis in, egestas eget quam. Fusce dapibus, tellus ac cursus - commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.

- Get started with Yii -
+
+

Congratulations!

-
+

You have successfully created your Yii-powered application.

- -
-
-

Heading

+

Get started with Yii

+
-

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris - condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. - Donec sed odio dui.

+ -
-

Heading

+
+
+

Heading

-

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris - condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. - Donec sed odio dui.

+

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu + fugiat nulla pariatur.

-

View details »

-
-
-

Heading

+

Yii Documentation »

+
+
+

Heading

-

Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta - felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum - massa.

+

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu + fugiat nulla pariatur.

+ +

Yii Forum »

+
+
+

Heading

+ +

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu + fugiat nulla pariatur.

+ +

Yii Extensions »

+
+
-

View details »

- diff --git a/apps/advanced/backend/views/site/login.php b/apps/advanced/backend/views/site/login.php index ea9f456..991d096 100644 --- a/apps/advanced/backend/views/site/login.php +++ b/apps/advanced/backend/views/site/login.php @@ -10,15 +10,21 @@ use yii\widgets\ActiveForm; $this->title = 'Login'; $this->params['breadcrumbs'][] = $this->title; ?> -

title); ?>

+