Browse Source
* upstream: (2012 commits) doc fix. Changed the signature of `urlCreator` and button creators for `yii\gridview\ActionColumn` parameter adjustment. The signature for `yii\gridview\ActionColumn::urlCreator` is changed - the `$action` parameter is moved to the first Fixed the signature of Schema::findUniqueIndexes(). reverted #1598 and added a test for it Fix wrong array index in unique indexes for MySql Making accesors public Get DB unique indexes information Fixes #1610: `Html::activeCheckboxList()` and `Html::activeRadioList()` will submit an empty string if no checkbox/radio is selected Gii should keep horizontal layout Documentation at "yii\authclient" updated. Doc comments at "yii\authclient" updated. Auth clients "Choice" doc comments updated. Auth clients "Choice" widget javascript advanced. Bootstrap's dropdown encodes also trailing caret tag Auth clients "Choice" widget markup updated. Gii should keep horizontal layout extended from codeception testcase, added docs Auth clients for Facebook, GitHub, LinkedIn added. ... Conflicts: framework/yii/helpers/BaseInflector.php tests/unit/framework/helpers/InflectorTest.phptags/2.0.0-beta
Antonio Ramirez
11 years ago
1233 changed files with 102088 additions and 65082 deletions
@ -0,0 +1,4 @@
|
||||
service_name: travis-ci |
||||
src_dir: framework/yii |
||||
coverage_clover: tests/unit/runtime/coveralls/clover.xml |
||||
json_path: tests/unit/runtime/coveralls/coveralls-upload.json |
@ -0,0 +1,23 @@
|
||||
# Autodetect text files |
||||
* text=auto |
||||
|
||||
# ...Unless the name matches the following overriding patterns |
||||
|
||||
# Definitively text files |
||||
*.php text |
||||
*.css text |
||||
*.js text |
||||
*.txt text |
||||
*.md text |
||||
*.xml text |
||||
*.json text |
||||
*.bat text |
||||
*.sql text |
||||
*.xml text |
||||
*.yml text |
||||
|
||||
# Ensure those won't be messed up with |
||||
*.png binary |
||||
*.jpg binary |
||||
*.gif binary |
||||
*.ttf binary |
@ -1,15 +1,33 @@
|
||||
language: php |
||||
|
||||
php: |
||||
- 5.3 |
||||
- 5.4 |
||||
- 5.5 |
||||
# - hhvm # commented until composer or hhvm get fixed: https://github.com/facebook/hhvm/issues/1347 |
||||
|
||||
env: |
||||
- DB=mysql |
||||
services: |
||||
- redis-server |
||||
- memcached |
||||
- elasticsearch |
||||
- mongodb |
||||
|
||||
install: |
||||
- composer self-update && composer --version |
||||
# - composer require satooshi/php-coveralls 0.6.* --dev --prefer-dist |
||||
- tests/unit/data/travis/mongodb-setup.sh |
||||
- tests/unit/data/travis/apc-setup.sh |
||||
- tests/unit/data/travis/memcache-setup.sh |
||||
- tests/unit/data/travis/cubrid-setup.sh |
||||
|
||||
before_script: |
||||
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database IF NOT EXISTS yiitest;'; fi" |
||||
- psql -U postgres -c 'drop database if exists yiitest;'; |
||||
- psql -U postgres -c 'create database yiitest;'; |
||||
script: phpunit |
||||
- echo 'elasticsearch version ' && curl http://localhost:9200/ |
||||
- mysql -e 'CREATE DATABASE yiitest;'; |
||||
- psql -U postgres -c 'CREATE DATABASE yiitest;'; |
||||
- tests/unit/data/travis/sphinx-setup.sh |
||||
- mongo yii2test --eval 'db.addUser("travis", "test");' |
||||
|
||||
script: |
||||
- phpunit --coverage-text --coverage-clover tests/unit/runtime/coveralls/clover.xml --verbose --exclude-group mssql,oci,wincache,xcache,zenddata,vendor |
||||
|
||||
#after_script: |
||||
# - php vendor/bin/coveralls |
||||
|
@ -0,0 +1,26 @@
|
||||
<?php |
||||
/** |
||||
* @link http://www.yiiframework.com/ |
||||
* @copyright Copyright (c) 2008 Yii Software LLC |
||||
* @license http://www.yiiframework.com/license/ |
||||
*/ |
||||
|
||||
namespace backend\assets; |
||||
|
||||
use yii\web\AssetBundle; |
||||
|
||||
/** |
||||
* @author Qiang Xue <qiang.xue@gmail.com> |
||||
* @since 2.0 |
||||
*/ |
||||
class AppAsset extends AssetBundle |
||||
{ |
||||
public $basePath = '@webroot'; |
||||
public $baseUrl = '@web'; |
||||
public $css = ['css/site.css']; |
||||
public $js = []; |
||||
public $depends = [ |
||||
'yii\web\YiiAsset', |
||||
'yii\bootstrap\BootstrapAsset', |
||||
]; |
||||
} |
@ -1,18 +0,0 @@
|
||||
<?php |
||||
|
||||
return array( |
||||
'app' => array( |
||||
'basePath' => '@wwwroot', |
||||
'baseUrl' => '@www', |
||||
'css' => array( |
||||
'css/site.css', |
||||
), |
||||
'js' => array( |
||||
|
||||
), |
||||
'depends' => array( |
||||
'yii', |
||||
'yii/bootstrap/responsive', |
||||
), |
||||
), |
||||
); |
@ -1,5 +1,4 @@
|
||||
<?php |
||||
|
||||
return array( |
||||
return [ |
||||
'adminEmail' => 'admin@example.com', |
||||
); |
||||
]; |
||||
|
@ -1,64 +1,64 @@
|
||||
<?php |
||||
use backend\assets\AppAsset; |
||||
use yii\helpers\Html; |
||||
use yii\widgets\Menu; |
||||
use yii\bootstrap\Nav; |
||||
use yii\bootstrap\NavBar; |
||||
use yii\widgets\Breadcrumbs; |
||||
use yii\debug\Toolbar; |
||||
|
||||
/** |
||||
* @var $this \yii\base\View |
||||
* @var $content string |
||||
* @var \yii\web\View $this |
||||
* @var string $content |
||||
*/ |
||||
$this->registerAssetBundle('app'); |
||||
AppAsset::register($this); |
||||
?> |
||||
<?php $this->beginPage(); ?> |
||||
<?php $this->beginPage() ?> |
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
<html lang="<?= Yii::$app->language ?>">
|
||||
<head> |
||||
<meta charset="utf-8"/> |
||||
<title><?php echo Html::encode($this->title); ?></title>
|
||||
<?php $this->head(); ?> |
||||
<meta charset="<?= Yii::$app->charset ?>"/>
|
||||
<title><?= Html::encode($this->title) ?></title>
|
||||
<?php $this->head() ?> |
||||
</head> |
||||
<body> |
||||
<div class="container"> |
||||
<?php $this->beginBody(); ?> |
||||
<div class="masthead"> |
||||
<h3 class="muted">My Company</h3> |
||||
<?php $this->beginBody() ?> |
||||
<?php |
||||
NavBar::begin([ |
||||
'brandLabel' => 'My Company', |
||||
'brandUrl' => Yii::$app->homeUrl, |
||||
'options' => [ |
||||
'class' => 'navbar-inverse navbar-fixed-top', |
||||
], |
||||
]); |
||||
$menuItems = [ |
||||
['label' => 'Home', 'url' => ['/site/index']], |
||||
]; |
||||
if (Yii::$app->user->isGuest) { |
||||
$menuItems[] = ['label' => 'Login', 'url' => ['/site/login']]; |
||||
} else { |
||||
$menuItems[] = ['label' => 'Logout (' . Yii::$app->user->identity->username .')' , 'url' => ['/site/logout']]; |
||||
} |
||||
echo Nav::widget([ |
||||
'options' => ['class' => 'navbar-nav navbar-right'], |
||||
'items' => $menuItems, |
||||
]); |
||||
NavBar::end(); |
||||
?> |
||||
|
||||
<div class="navbar"> |
||||
<div class="navbar-inner"> |
||||
<div class="container"> |
||||
<?php echo Menu::widget(array( |
||||
'options' => array('class' => 'nav'), |
||||
'items' => array( |
||||
array('label' => 'Home', 'url' => array('/site/index')), |
||||
Yii::$app->user->isGuest ? |
||||
array('label' => 'Login', 'url' => array('/site/login')) : |
||||
array('label' => 'Logout (' . Yii::$app->user->identity->username .')' , 'url' => array('/site/logout')), |
||||
), |
||||
)); ?> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<!-- /.navbar --> |
||||
<div class="container"> |
||||
<?= Breadcrumbs::widget([ |
||||
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], |
||||
]) ?> |
||||
<?= $content ?> |
||||
</div> |
||||
|
||||
<?php echo Breadcrumbs::widget(array( |
||||
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : array(), |
||||
)); ?> |
||||
<?php echo $content; ?> |
||||
|
||||
<hr> |
||||
<footer class="footer"> |
||||
<div class="container"> |
||||
<p class="pull-left">© My Company <?= date('Y') ?></p>
|
||||
<p class="pull-right"><?= Yii::powered() ?></p>
|
||||
</div> |
||||
</footer> |
||||
|
||||
<div class="footer"> |
||||
<p>© My Company <?php echo date('Y'); ?></p>
|
||||
<p> |
||||
<?php echo Yii::powered(); ?> |
||||
Template by <a href="http://twitter.github.io/bootstrap/">Twitter Bootstrap</a> |
||||
</p> |
||||
</div> |
||||
<?php $this->endBody(); ?> |
||||
</div> |
||||
<?php echo Toolbar::widget(); ?> |
||||
<?php $this->endBody() ?> |
||||
</body> |
||||
</html> |
||||
<?php $this->endPage(); ?> |
||||
<?php $this->endPage() ?> |
||||
|
@ -0,0 +1,29 @@
|
||||
<?php |
||||
|
||||
use yii\helpers\Html; |
||||
|
||||
/** |
||||
* @var yii\web\View $this |
||||
* @var string $name |
||||
* @var string $message |
||||
* @var Exception $exception |
||||
*/ |
||||
|
||||
$this->title = $name; |
||||
?> |
||||
<div class="site-error"> |
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<div class="alert alert-danger"> |
||||
<?= nl2br(Html::encode($message)) ?> |
||||
</div> |
||||
|
||||
<p> |
||||
The above error occurred while the Web server was processing your request. |
||||
</p> |
||||
<p> |
||||
Please contact us if you think this is a server error. Thank you. |
||||
</p> |
||||
|
||||
</div> |
@ -0,0 +1,45 @@
|
||||
body { |
||||
padding-top: 70px; |
||||
} |
||||
|
||||
.footer { |
||||
border-top: 1px solid #ddd; |
||||
margin-top: 30px; |
||||
padding-top: 15px; |
||||
padding-bottom: 30px; |
||||
} |
||||
|
||||
.jumbotron { |
||||
text-align: center; |
||||
background-color: transparent; |
||||
} |
||||
.jumbotron .btn { |
||||
font-size: 21px; |
||||
padding: 14px 24px; |
||||
} |
||||
|
||||
.not-set { |
||||
color: #c55; |
||||
font-style: italic; |
||||
} |
||||
|
||||
/* add sorting icons to gridview sort links */ |
||||
a.asc:after, a.desc:after { |
||||
position: relative; |
||||
top: 1px; |
||||
display: inline-block; |
||||
font-family: 'Glyphicons Halflings'; |
||||
font-style: normal; |
||||
font-weight: normal; |
||||
line-height: 1; |
||||
padding-left: 5px; |
||||
} |
||||
|
||||
a.asc:after { content: /*"\e113"*/"\e151"; } |
||||
a.desc:after { content: /*"\e114"*/"\e152"; } |
||||
|
||||
.sort-numerical a.asc:after { content: "\e153"; } |
||||
.sort-numerical a.desc:after { content: "\e154"; } |
||||
|
||||
.sort-ordinal a.asc:after { content: "\e155"; } |
||||
.sort-ordinal a.desc:after { content: "\e156"; } |
After Width: | Height: | Size: 1.1 KiB |
@ -1,78 +0,0 @@
|
||||
body { |
||||
padding-top: 20px; |
||||
padding-bottom: 60px; |
||||
} |
||||
|
||||
/* Custom container */ |
||||
.container { |
||||
margin: 0 auto; |
||||
max-width: 1000px; |
||||
} |
||||
|
||||
.container > hr { |
||||
margin: 60px 0; |
||||
} |
||||
|
||||
/* Main marketing message and sign up button */ |
||||
.jumbotron { |
||||
margin: 80px 0; |
||||
text-align: center; |
||||
} |
||||
|
||||
.jumbotron h1 { |
||||
font-size: 100px; |
||||
line-height: 1; |
||||
} |
||||
|
||||
.jumbotron .lead { |
||||
font-size: 24px; |
||||
line-height: 1.25; |
||||
} |
||||
|
||||
.jumbotron .btn { |
||||
font-size: 21px; |
||||
padding: 14px 24px; |
||||
} |
||||
|
||||
/* Supporting marketing content */ |
||||
.marketing { |
||||
margin: 60px 0; |
||||
} |
||||
|
||||
.marketing p + h4 { |
||||
margin-top: 28px; |
||||
} |
||||
|
||||
/* Customize the navbar links to be fill the entire space of the .navbar */ |
||||
.navbar .navbar-inner { |
||||
padding: 0; |
||||
} |
||||
|
||||
.navbar .nav { |
||||
margin: 0; |
||||
display: table; |
||||
width: 100%; |
||||
} |
||||
|
||||
.navbar .nav li { |
||||
display: table-cell; |
||||
width: 1%; |
||||
float: none; |
||||
} |
||||
|
||||
.navbar .nav li a { |
||||
font-weight: bold; |
||||
text-align: center; |
||||
border-left: 1px solid rgba(255, 255, 255, .75); |
||||
border-right: 1px solid rgba(0, 0, 0, .1); |
||||
} |
||||
|
||||
.navbar .nav li:first-child a { |
||||
border-left: 0; |
||||
border-radius: 3px 0 0 3px; |
||||
} |
||||
|
||||
.navbar .nav li:last-child a { |
||||
border-right: 0; |
||||
border-radius: 0 3px 3px 0; |
||||
} |
@ -1,16 +1,28 @@
|
||||
<?php |
||||
|
||||
return array( |
||||
Yii::setAlias('common', realpath(__DIR__ . '/../')); |
||||
Yii::setAlias('frontend', realpath(__DIR__ . '/../../frontend')); |
||||
Yii::setAlias('backend', realpath(__DIR__ . '/../../backend')); |
||||
Yii::setAlias('console', realpath(__DIR__ . '/../../console')); |
||||
|
||||
return [ |
||||
'adminEmail' => 'admin@example.com', |
||||
'supportEmail' => 'support@example.com', |
||||
|
||||
'components.cache' => array( |
||||
'components.cache' => [ |
||||
'class' => 'yii\caching\FileCache', |
||||
), |
||||
], |
||||
|
||||
'components.mail' => [ |
||||
'class' => 'yii\swiftmailer\Mailer', |
||||
'viewPath' => '@common/mails', |
||||
], |
||||
|
||||
'components.db' => array( |
||||
'components.db' => [ |
||||
'class' => 'yii\db\Connection', |
||||
'dsn' => 'mysql:host=localhost;dbname=yii2advanced', |
||||
'username' => 'root', |
||||
'password' => '', |
||||
), |
||||
); |
||||
'charset' => 'utf8', |
||||
], |
||||
]; |
||||
|
@ -0,0 +1,24 @@
|
||||
<?php |
||||
use yii\helpers\Html; |
||||
use yii\mail\BaseMessage; |
||||
|
||||
/** |
||||
* @var \yii\web\View $this |
||||
* @var BaseMessage $content |
||||
*/ |
||||
?> |
||||
<?php $this->beginPage() ?> |
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
||||
<html xmlns="http://www.w3.org/1999/xhtml"> |
||||
<head> |
||||
<meta http-equiv="Content-Type" content="text/html; charset=<?= Yii::$app->charset ?>" />
|
||||
<title><?= Html::encode($this->title) ?></title>
|
||||
<?php $this->head() ?> |
||||
</head> |
||||
<body> |
||||
<?php $this->beginBody() ?> |
||||
<?= $content ?> |
||||
<?php $this->endBody() ?> |
||||
</body> |
||||
</html> |
||||
<?php $this->endPage() ?> |
@ -0,0 +1,16 @@
|
||||
<?php |
||||
use yii\helpers\Html; |
||||
|
||||
/** |
||||
* @var yii\web\View $this |
||||
* @var common\models\User $user; |
||||
*/ |
||||
|
||||
$resetLink = Yii::$app->urlManager->createAbsoluteUrl('site/reset-password', ['token' => $user->password_reset_token]); |
||||
?> |
||||
|
||||
Hello <?= Html::encode($user->username) ?>,
|
||||
|
||||
Follow the link below to reset your password: |
||||
|
||||
<?= Html::a(Html::encode($resetLink), $resetLink) ?> |
@ -1,164 +0,0 @@
|
||||
{ |
||||
"_readme": [ |
||||
"This file locks the dependencies of your project to a known state", |
||||
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" |
||||
], |
||||
"hash": "2d1053fbaaf2044054f273a71d0ccde0", |
||||
"packages": [ |
||||
{ |
||||
"name": "yiisoft/yii2", |
||||
"version": "dev-master", |
||||
"source": { |
||||
"type": "git", |
||||
"url": "https://github.com/yiisoft/yii2-framework.git", |
||||
"reference": "3ad6334be076a80df3b2ea0b57f38bd0c6901989" |
||||
}, |
||||
"dist": { |
||||
"type": "zip", |
||||
"url": "https://api.github.com/repos/yiisoft/yii2-framework/zipball/3ad6334be076a80df3b2ea0b57f38bd0c6901989", |
||||
"reference": "3ad6334be076a80df3b2ea0b57f38bd0c6901989", |
||||
"shasum": "" |
||||
}, |
||||
"require": { |
||||
"ext-mbstring": "*", |
||||
"lib-pcre": "*", |
||||
"php": ">=5.3.7" |
||||
}, |
||||
"suggest": { |
||||
"ezyang/htmlpurifier": "Required by HtmlPurifier.", |
||||
"michelf/php-markdown": "Required by Markdown.", |
||||
"smarty/smarty": "Required by SmartyViewRenderer.", |
||||
"twig/twig": "Required by TwigViewRenderer." |
||||
}, |
||||
"type": "library", |
||||
"autoload": { |
||||
"psr-0": { |
||||
"yii\\": "/" |
||||
} |
||||
}, |
||||
"notification-url": "https://packagist.org/downloads/", |
||||
"license": [ |
||||
"BSD-3-Clause" |
||||
], |
||||
"authors": [ |
||||
{ |
||||
"name": "Qiang Xue", |
||||
"email": "qiang.xue@gmail.com", |
||||
"homepage": "http://www.yiiframework.com/", |
||||
"role": "Founder and project lead" |
||||
}, |
||||
{ |
||||
"name": "Alexander Makarov", |
||||
"email": "sam@rmcreative.ru", |
||||
"homepage": "http://rmcreative.ru/", |
||||
"role": "Core framework development" |
||||
}, |
||||
{ |
||||
"name": "Maurizio Domba", |
||||
"homepage": "http://mdomba.info/", |
||||
"role": "Core framework development" |
||||
}, |
||||
{ |
||||
"name": "Carsten Brandt", |
||||
"email": "mail@cebe.cc", |
||||
"homepage": "http://cebe.cc/", |
||||
"role": "Core framework development" |
||||
}, |
||||
{ |
||||
"name": "Wei Zhuo", |
||||
"email": "weizhuo@gmail.com", |
||||
"role": "Project site maintenance and development" |
||||
}, |
||||
{ |
||||
"name": "Sebastián Thierer", |
||||
"email": "sebas@artfos.com", |
||||
"role": "Component development" |
||||
}, |
||||
{ |
||||
"name": "Jeffrey Winesett", |
||||
"email": "jefftulsa@gmail.com", |
||||
"role": "Documentation and marketing" |
||||
}, |
||||
{ |
||||
"name": "Timur Ruziev", |
||||
"email": "resurtm@gmail.com", |
||||
"homepage": "http://resurtm.com/", |
||||
"role": "Core framework development" |
||||
}, |
||||
{ |
||||
"name": "Paul Klimov", |
||||
"email": "klimov.paul@gmail.com", |
||||
"role": "Core framework development" |
||||
} |
||||
], |
||||
"description": "Yii2 Web Programming Framework", |
||||
"homepage": "http://www.yiiframework.com/", |
||||
"keywords": [ |
||||
"framework", |
||||
"yii" |
||||
], |
||||
"time": "2013-06-02 19:19:29" |
||||
}, |
||||
{ |
||||
"name": "yiisoft/yii2-composer", |
||||
"version": "dev-master", |
||||
"source": { |
||||
"type": "git", |
||||
"url": "https://github.com/yiisoft/yii2-composer.git", |
||||
"reference": "7ce4060faca940b836ab88de207638940a0a0568" |
||||
}, |
||||
"dist": { |
||||
"type": "zip", |
||||
"url": "https://api.github.com/repos/yiisoft/yii2-composer/zipball/7ce4060faca940b836ab88de207638940a0a0568", |
||||
"reference": "7ce4060faca940b836ab88de207638940a0a0568", |
||||
"shasum": "" |
||||
}, |
||||
"require": { |
||||
"yiisoft/yii2": "*" |
||||
}, |
||||
"type": "library", |
||||
"autoload": { |
||||
"psr-0": { |
||||
"yii\\composer": "" |
||||
} |
||||
}, |
||||
"notification-url": "https://packagist.org/downloads/", |
||||
"license": [ |
||||
"BSD-3-Clause" |
||||
], |
||||
"authors": [ |
||||
{ |
||||
"name": "Qiang Xue", |
||||
"email": "qiang.xue@gmail.com", |
||||
"homepage": "http://www.yiiframework.com/", |
||||
"role": "Founder and project lead" |
||||
} |
||||
], |
||||
"description": "The composer integration for the Yii framework", |
||||
"keywords": [ |
||||
"composer", |
||||
"install", |
||||
"update", |
||||
"yii" |
||||
], |
||||
"time": "2013-05-23 19:12:45" |
||||
} |
||||
], |
||||
"packages-dev": [ |
||||
|
||||
], |
||||
"aliases": [ |
||||
|
||||
], |
||||
"minimum-stability": "dev", |
||||
"stability-flags": { |
||||
"yiisoft/yii2": 20, |
||||
"yiisoft/yii2-composer": 20 |
||||
}, |
||||
"platform": { |
||||
"php": ">=5.3.0" |
||||
}, |
||||
"platform-dev": [ |
||||
|
||||
] |
||||
} |
@ -1,5 +1,4 @@
|
||||
<?php |
||||
|
||||
return array( |
||||
return [ |
||||
'adminEmail' => 'admin@example.com', |
||||
); |
||||
]; |
||||
|
@ -0,0 +1,11 @@
|
||||
<?php |
||||
return [ |
||||
'preload' => [ |
||||
//'debug', |
||||
], |
||||
'modules' => [ |
||||
// 'debug' => [ |
||||
// 'class' => 'yii\debug\Module', |
||||
// ], |
||||
], |
||||
]; |
@ -0,0 +1,3 @@
|
||||
<?php |
||||
return [ |
||||
]; |
@ -0,0 +1,14 @@
|
||||
<?php |
||||
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/Yii.php'); |
||||
|
||||
$config = yii\helpers\ArrayHelper::merge( |
||||
require(__DIR__ . '/../config/main.php'), |
||||
require(__DIR__ . '/../config/main-local.php') |
||||
); |
||||
|
||||
$application = new yii\web\Application($config); |
||||
$application->run(); |
@ -1,17 +0,0 @@
|
||||
<?php |
||||
return array( |
||||
'modules' => array( |
||||
// 'debug' => array( |
||||
// 'class' => 'yii\debug\Module', |
||||
// ), |
||||
), |
||||
'components' => array( |
||||
'log' => array( |
||||
'targets' => array( |
||||
// array( |
||||
// 'class' => 'yii\logging\DebugTarget', |
||||
// ) |
||||
), |
||||
), |
||||
), |
||||
); |
@ -1,3 +0,0 @@
|
||||
<?php |
||||
return array( |
||||
); |
@ -1,14 +0,0 @@
|
||||
<?php |
||||
// comment out the following line to disable debug mode |
||||
defined('YII_DEBUG') or define('YII_DEBUG', true); |
||||
|
||||
require(__DIR__ . '/../../vendor/yiisoft/yii2/yii/Yii.php'); |
||||
require(__DIR__ . '/../../vendor/autoload.php'); |
||||
|
||||
$config = yii\helpers\ArrayHelper::merge( |
||||
require(__DIR__ . '/../config/main.php'), |
||||
require(__DIR__ . '/../config/main-local.php') |
||||
); |
||||
|
||||
$application = new yii\web\Application($config); |
||||
$application->run(); |
@ -1,3 +1,3 @@
|
||||
<?php |
||||
return array( |
||||
); |
||||
return [ |
||||
]; |
||||
|
@ -1,3 +1,3 @@
|
||||
<?php |
||||
return array( |
||||
); |
||||
return [ |
||||
]; |
||||
|
@ -1,3 +1,3 @@
|
||||
<?php |
||||
return array( |
||||
); |
||||
return [ |
||||
]; |
||||
|
@ -1,17 +1,11 @@
|
||||
<?php |
||||
return array( |
||||
'modules' => array( |
||||
// 'debug' => array( |
||||
return [ |
||||
'preload' => [ |
||||
//'debug', |
||||
], |
||||
'modules' => [ |
||||
// 'debug' => [ |
||||
// 'class' => 'yii\debug\Module', |
||||
// ), |
||||
), |
||||
'components' => array( |
||||
'log' => array( |
||||
'targets' => array( |
||||
// array( |
||||
// 'class' => 'yii\logging\DebugTarget', |
||||
// ) |
||||
), |
||||
), |
||||
), |
||||
); |
||||
// ], |
||||
], |
||||
]; |
||||
|
@ -1,3 +1,3 @@
|
||||
<?php |
||||
return array( |
||||
); |
||||
return [ |
||||
]; |
||||
|
@ -0,0 +1,14 @@
|
||||
<?php |
||||
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/Yii.php'); |
||||
|
||||
$config = yii\helpers\ArrayHelper::merge( |
||||
require(__DIR__ . '/../config/main.php'), |
||||
require(__DIR__ . '/../config/main-local.php') |
||||
); |
||||
|
||||
$application = new yii\web\Application($config); |
||||
$application->run(); |
@ -1,15 +0,0 @@
|
||||
<?php |
||||
|
||||
// comment out the following line to disable debug mode |
||||
defined('YII_DEBUG') or define('YII_DEBUG', true); |
||||
|
||||
require(__DIR__ . '/../../vendor/yiisoft/yii2/yii/Yii.php'); |
||||
require(__DIR__ . '/../../vendor/autoload.php'); |
||||
|
||||
$config = yii\helpers\ArrayHelper::merge( |
||||
require(__DIR__ . '/../config/main.php'), |
||||
require(__DIR__ . '/../config/main-local.php') |
||||
); |
||||
|
||||
$application = new yii\web\Application($config); |
||||
$application->run(); |
@ -0,0 +1,3 @@
|
||||
<?php |
||||
return [ |
||||
]; |
@ -0,0 +1,3 @@
|
||||
<?php |
||||
return [ |
||||
]; |
@ -0,0 +1,14 @@
|
||||
<?php |
||||
defined('YII_DEBUG') or define('YII_DEBUG', false); |
||||
defined('YII_ENV') or define('YII_ENV', 'prod'); |
||||
|
||||
require(__DIR__ . '/../../vendor/autoload.php'); |
||||
require(__DIR__ . '/../../vendor/yiisoft/yii2/yii/Yii.php'); |
||||
|
||||
$config = yii\helpers\ArrayHelper::merge( |
||||
require(__DIR__ . '/../config/main.php'), |
||||
require(__DIR__ . '/../config/main-local.php') |
||||
); |
||||
|
||||
$application = new yii\web\Application($config); |
||||
$application->run(); |
@ -1,3 +0,0 @@
|
||||
<?php |
||||
return array( |
||||
); |
@ -1,3 +0,0 @@
|
||||
<?php |
||||
return array( |
||||
); |
@ -1,14 +0,0 @@
|
||||
<?php |
||||
// comment out the following line to disable debug mode |
||||
defined('YII_DEBUG') or define('YII_DEBUG', false); |
||||
|
||||
require(__DIR__ . '/../../vendor/yiisoft/yii2/yii/Yii.php'); |
||||
require(__DIR__ . '/../../vendor/autoload.php'); |
||||
|
||||
$config = yii\helpers\ArrayHelper::merge( |
||||
require(__DIR__ . '/../config/main.php'), |
||||
require(__DIR__ . '/../config/main-local.php') |
||||
); |
||||
|
||||
$application = new yii\web\Application($config); |
||||
$application->run(); |
@ -1,3 +1,3 @@
|
||||
<?php |
||||
return array( |
||||
); |
||||
return [ |
||||
]; |
||||
|
@ -1,3 +1,3 @@
|
||||
<?php |
||||
return array( |
||||
); |
||||
return [ |
||||
]; |
||||
|
@ -1,3 +1,3 @@
|
||||
<?php |
||||
return array( |
||||
); |
||||
return [ |
||||
]; |
||||
|
@ -1,3 +1,3 @@
|
||||
<?php |
||||
return array( |
||||
); |
||||
return [ |
||||
]; |
||||
|
@ -1,3 +1,3 @@
|
||||
<?php |
||||
return array( |
||||
); |
||||
return [ |
||||
]; |
||||
|
@ -0,0 +1,14 @@
|
||||
<?php |
||||
defined('YII_DEBUG') or define('YII_DEBUG', false); |
||||
defined('YII_ENV') or define('YII_ENV', 'prod'); |
||||
|
||||
require(__DIR__ . '/../../vendor/autoload.php'); |
||||
require(__DIR__ . '/../../vendor/yiisoft/yii2/yii/Yii.php'); |
||||
|
||||
$config = yii\helpers\ArrayHelper::merge( |
||||
require(__DIR__ . '/../config/main.php'), |
||||
require(__DIR__ . '/../config/main-local.php') |
||||
); |
||||
|
||||
$application = new yii\web\Application($config); |
||||
$application->run(); |
@ -1,15 +0,0 @@
|
||||
<?php |
||||
|
||||
// comment out the following line to disable debug mode |
||||
defined('YII_DEBUG') or define('YII_DEBUG', false); |
||||
|
||||
require(__DIR__ . '/../../vendor/yiisoft/yii2/yii/Yii.php'); |
||||
require(__DIR__ . '/../../vendor/autoload.php'); |
||||
|
||||
$config = yii\helpers\ArrayHelper::merge( |
||||
require(__DIR__ . '/../config/main.php'), |
||||
require(__DIR__ . '/../config/main-local.php') |
||||
); |
||||
|
||||
$application = new yii\web\Application($config); |
||||
$application->run(); |
@ -0,0 +1,29 @@
|
||||
<?php |
||||
/** |
||||
* @link http://www.yiiframework.com/ |
||||
* @copyright Copyright (c) 2008 Yii Software LLC |
||||
* @license http://www.yiiframework.com/license/ |
||||
*/ |
||||
|
||||
namespace frontend\assets; |
||||
|
||||
use yii\web\AssetBundle; |
||||
|
||||
/** |
||||
* @author Qiang Xue <qiang.xue@gmail.com> |
||||
* @since 2.0 |
||||
*/ |
||||
class AppAsset extends AssetBundle |
||||
{ |
||||
public $basePath = '@webroot'; |
||||
public $baseUrl = '@web'; |
||||
public $css = [ |
||||
'css/site.css', |
||||
]; |
||||
public $js = [ |
||||
]; |
||||
public $depends = [ |
||||
'yii\web\YiiAsset', |
||||
'yii\bootstrap\BootstrapAsset', |
||||
]; |
||||
} |
@ -1,18 +0,0 @@
|
||||
<?php |
||||
|
||||
return array( |
||||
'app' => array( |
||||
'basePath' => '@wwwroot', |
||||
'baseUrl' => '@www', |
||||
'css' => array( |
||||
'css/site.css', |
||||
), |
||||
'js' => array( |
||||
|
||||
), |
||||
'depends' => array( |
||||
'yii', |
||||
'yii/bootstrap/responsive', |
||||
), |
||||
), |
||||
); |
@ -1,5 +1,4 @@
|
||||
<?php |
||||
|
||||
return array( |
||||
return [ |
||||
'adminEmail' => 'admin@example.com', |
||||
); |
||||
]; |
||||
|
@ -1,66 +1,69 @@
|
||||
<?php |
||||
use yii\helpers\Html; |
||||
use yii\widgets\Menu; |
||||
use yii\bootstrap\Nav; |
||||
use yii\bootstrap\NavBar; |
||||
use yii\widgets\Breadcrumbs; |
||||
use yii\debug\Toolbar; |
||||
use frontend\assets\AppAsset; |
||||
use frontend\widgets\Alert; |
||||
|
||||
/** |
||||
* @var $this \yii\base\View |
||||
* @var $content string |
||||
* @var \yii\web\View $this |
||||
* @var string $content |
||||
*/ |
||||
$this->registerAssetBundle('app'); |
||||
AppAsset::register($this); |
||||
?> |
||||
<?php $this->beginPage(); ?> |
||||
<?php $this->beginPage() ?> |
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
<html lang="<?= Yii::$app->language ?>">
|
||||
<head> |
||||
<meta charset="utf-8"/> |
||||
<title><?php echo Html::encode($this->title); ?></title>
|
||||
<?php $this->head(); ?> |
||||
<meta charset="<?= Yii::$app->charset ?>"/>
|
||||
<title><?= Html::encode($this->title) ?></title>
|
||||
<?php $this->head() ?> |
||||
</head> |
||||
<body> |
||||
<div class="container"> |
||||
<?php $this->beginBody(); ?> |
||||
<div class="masthead"> |
||||
<h3 class="muted">My Company</h3> |
||||
<?php $this->beginBody() ?> |
||||
<?php |
||||
NavBar::begin([ |
||||
'brandLabel' => 'My Company', |
||||
'brandUrl' => Yii::$app->homeUrl, |
||||
'options' => [ |
||||
'class' => 'navbar-inverse navbar-fixed-top', |
||||
], |
||||
]); |
||||
$menuItems = [ |
||||
['label' => 'Home', 'url' => ['/site/index']], |
||||
['label' => 'About', 'url' => ['/site/about']], |
||||
['label' => 'Contact', 'url' => ['/site/contact']], |
||||
]; |
||||
if (Yii::$app->user->isGuest) { |
||||
$menuItems[] = ['label' => 'Signup', 'url' => ['/site/signup']]; |
||||
$menuItems[] = ['label' => 'Login', 'url' => ['/site/login']]; |
||||
} else { |
||||
$menuItems[] = ['label' => 'Logout (' . Yii::$app->user->identity->username .')' , 'url' => ['/site/logout']]; |
||||
} |
||||
echo Nav::widget([ |
||||
'options' => ['class' => 'navbar-nav navbar-right'], |
||||
'items' => $menuItems, |
||||
]); |
||||
NavBar::end(); |
||||
?> |
||||
|
||||
<div class="navbar"> |
||||
<div class="navbar-inner"> |
||||
<div class="container"> |
||||
<?php echo Menu::widget(array( |
||||
'options' => array('class' => 'nav'), |
||||
'items' => array( |
||||
array('label' => 'Home', 'url' => array('/site/index')), |
||||
array('label' => 'About', 'url' => array('/site/about')), |
||||
array('label' => 'Contact', 'url' => array('/site/contact')), |
||||
Yii::$app->user->isGuest ? |
||||
array('label' => 'Login', 'url' => array('/site/login')) : |
||||
array('label' => 'Logout (' . Yii::$app->user->identity->username .')' , 'url' => array('/site/logout')), |
||||
), |
||||
)); ?> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<!-- /.navbar --> |
||||
<div class="container"> |
||||
<?= Breadcrumbs::widget([ |
||||
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], |
||||
]) ?> |
||||
<?= Alert::widget() ?> |
||||
<?= $content ?> |
||||
</div> |
||||
|
||||
<?php echo Breadcrumbs::widget(array( |
||||
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : array(), |
||||
)); ?> |
||||
<?php echo $content; ?> |
||||
|
||||
<hr> |
||||
<footer class="footer"> |
||||
<div class="container"> |
||||
<p class="pull-left">© My Company <?= date('Y') ?></p>
|
||||
<p class="pull-right"><?= Yii::powered() ?></p>
|
||||
</div> |
||||
</footer> |
||||
|
||||
<div class="footer"> |
||||
<p>© My Company <?php echo date('Y'); ?></p>
|
||||
<p> |
||||
<?php echo Yii::powered(); ?> |
||||
Template by <a href="http://twitter.github.io/bootstrap/">Twitter Bootstrap</a> |
||||
</p> |
||||
</div> |
||||
<?php $this->endBody(); ?> |
||||
</div> |
||||
<?php echo Toolbar::widget(); ?> |
||||
<?php $this->endBody() ?> |
||||
</body> |
||||
</html> |
||||
<?php $this->endPage(); ?> |
||||
<?php $this->endPage() ?> |
||||
|
@ -1,16 +1,16 @@
|
||||
<?php |
||||
use yii\helpers\Html; |
||||
|
||||
/** |
||||
* @var yii\base\View $this |
||||
* @var yii\web\View $this |
||||
*/ |
||||
$this->title = 'About'; |
||||
$this->params['breadcrumbs'][] = $this->title; |
||||
?> |
||||
<h1><?php echo Html::encode($this->title); ?></h1>
|
||||
|
||||
<p> |
||||
This is the About page. You may modify the following file to customize its content: |
||||
</p> |
||||
<div class="site-about"> |
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<code><?php echo __FILE__; ?></code>
|
||||
<p>This is the About page. You may modify the following file to customize its content:</p> |
||||
|
||||
<code><?= __FILE__ ?></code>
|
||||
</div> |
||||
|
@ -1,46 +1,39 @@
|
||||
<?php |
||||
use yii\helpers\Html; |
||||
use yii\widgets\ActiveForm; |
||||
use yii\widgets\Captcha; |
||||
use yii\captcha\Captcha; |
||||
|
||||
/** |
||||
* @var yii\base\View $this |
||||
* @var yii\web\View $this |
||||
* @var yii\widgets\ActiveForm $form |
||||
* @var app\models\ContactForm $model |
||||
*/ |
||||
$this->title = 'Contact'; |
||||
$this->params['breadcrumbs'][] = $this->title; |
||||
?> |
||||
<h1><?php echo Html::encode($this->title); ?></h1>
|
||||
<div class="site-contact"> |
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?php if (Yii::$app->session->hasFlash('contactFormSubmitted')): ?> |
||||
<div class="alert alert-success"> |
||||
Thank you for contacting us. We will respond to you as soon as possible. |
||||
</div> |
||||
<?php return; endif; ?> |
||||
|
||||
<p> |
||||
If you have business inquiries or other questions, please fill out the following form to contact us. Thank you. |
||||
</p> |
||||
<p> |
||||
If you have business inquiries or other questions, please fill out the following form to contact us. Thank you. |
||||
</p> |
||||
|
||||
<?php $form = ActiveForm::begin(array( |
||||
'options' => array('class' => 'form-horizontal'), |
||||
'fieldConfig' => array('inputOptions' => array('class' => 'input-xlarge')), |
||||
)); ?> |
||||
<?php echo $form->field($model, 'name')->textInput(); ?> |
||||
<?php echo $form->field($model, 'email')->textInput(); ?> |
||||
<?php echo $form->field($model, 'subject')->textInput(); ?> |
||||
<?php echo $form->field($model, 'body')->textArea(array('rows' => 6)); ?> |
||||
<?php |
||||
$field = $form->field($model, 'verifyCode'); |
||||
echo $field->begin() |
||||
. $field->label() |
||||
. Captcha::widget() |
||||
. Html::activeTextInput($model, 'verifyCode', array('class' => 'input-medium')) |
||||
. $field->error() |
||||
. $field->end(); |
||||
?> |
||||
<div class="form-actions"> |
||||
<?php echo Html::submitButton('Submit', null, null, array('class' => 'btn btn-primary')); ?> |
||||
<div class="row"> |
||||
<div class="col-lg-5"> |
||||
<?php $form = ActiveForm::begin(['id' => 'contact-form']); ?> |
||||
<?= $form->field($model, 'name') ?> |
||||
<?= $form->field($model, 'email') ?> |
||||
<?= $form->field($model, 'subject') ?> |
||||
<?= $form->field($model, 'body')->textArea(['rows' => 6]) ?> |
||||
<?= $form->field($model, 'verifyCode')->widget(Captcha::className(), [ |
||||
'options' => ['class' => 'form-control'], |
||||
'template' => '<div class="row"><div class="col-lg-3">{image}</div><div class="col-lg-6">{input}</div></div>', |
||||
]) ?> |
||||
<div class="form-group"> |
||||
<?= Html::submitButton('Submit', ['class' => 'btn btn-primary']) ?> |
||||
</div> |
||||
<?php ActiveForm::end(); ?> |
||||
</div> |
||||
</div> |
||||
<?php ActiveForm::end(); ?> |
||||
|
||||
</div> |
||||
|
@ -0,0 +1,29 @@
|
||||
<?php |
||||
|
||||
use yii\helpers\Html; |
||||
|
||||
/** |
||||
* @var yii\web\View $this |
||||
* @var string $name |
||||
* @var string $message |
||||
* @var Exception $exception |
||||
*/ |
||||
|
||||
$this->title = $name; |
||||
?> |
||||
<div class="site-error"> |
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<div class="alert alert-danger"> |
||||
<?= nl2br(Html::encode($message)) ?> |
||||
</div> |
||||
|
||||
<p> |
||||
The above error occurred while the Web server was processing your request. |
||||
</p> |
||||
<p> |
||||
Please contact us if you think this is a server error. Thank you. |
||||
</p> |
||||
|
||||
</div> |
@ -0,0 +1,28 @@
|
||||
<?php |
||||
use yii\helpers\Html; |
||||
use yii\widgets\ActiveForm; |
||||
|
||||
/** |
||||
* @var yii\web\View $this |
||||
* @var yii\widgets\ActiveForm $form |
||||
* @var common\models\User $model |
||||
*/ |
||||
$this->title = 'Request password reset'; |
||||
$this->params['breadcrumbs'][] = $this->title; |
||||
?> |
||||
<div class="site-request-password-reset"> |
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>Please fill out your email. A link to reset password will be sent there.</p> |
||||
|
||||
<div class="row"> |
||||
<div class="col-lg-5"> |
||||
<?php $form = ActiveForm::begin(['id' => 'request-password-reset-form']); ?> |
||||
<?= $form->field($model, 'email') ?> |
||||
<div class="form-group"> |
||||
<?= Html::submitButton('Send', ['class' => 'btn btn-primary']) ?> |
||||
</div> |
||||
<?php ActiveForm::end(); ?> |
||||
</div> |
||||
</div> |
||||
</div> |
@ -0,0 +1,28 @@
|
||||
<?php |
||||
use yii\helpers\Html; |
||||
use yii\widgets\ActiveForm; |
||||
|
||||
/** |
||||
* @var yii\web\View $this |
||||
* @var yii\widgets\ActiveForm $form |
||||
* @var common\models\User $model |
||||
*/ |
||||
$this->title = 'Reset password'; |
||||
$this->params['breadcrumbs'][] = $this->title; |
||||
?> |
||||
<div class="site-reset-password"> |
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>Please choose your new password:</p> |
||||
|
||||
<div class="row"> |
||||
<div class="col-lg-5"> |
||||
<?php $form = ActiveForm::begin(['id' => 'reset-password-form']); ?> |
||||
<?= $form->field($model, 'password')->passwordInput() ?> |
||||
<div class="form-group"> |
||||
<?= Html::submitButton('Save', ['class' => 'btn btn-primary']) ?> |
||||
</div> |
||||
<?php ActiveForm::end(); ?> |
||||
</div> |
||||
</div> |
||||
</div> |
@ -0,0 +1,30 @@
|
||||
<?php |
||||
use yii\helpers\Html; |
||||
use yii\widgets\ActiveForm; |
||||
|
||||
/** |
||||
* @var yii\web\View $this |
||||
* @var yii\widgets\ActiveForm $form |
||||
* @var common\models\User $model |
||||
*/ |
||||
$this->title = 'Signup'; |
||||
$this->params['breadcrumbs'][] = $this->title; |
||||
?> |
||||
<div class="site-signup"> |
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>Please fill out the following fields to signup:</p> |
||||
|
||||
<div class="row"> |
||||
<div class="col-lg-5"> |
||||
<?php $form = ActiveForm::begin(['id' => 'form-signup']); ?> |
||||
<?= $form->field($model, 'username') ?> |
||||
<?= $form->field($model, 'email') ?> |
||||
<?= $form->field($model, 'password')->passwordInput() ?> |
||||
<div class="form-group"> |
||||
<?= Html::submitButton('Signup', ['class' => 'btn btn-primary']) ?> |
||||
</div> |
||||
<?php ActiveForm::end(); ?> |
||||
</div> |
||||
</div> |
||||
</div> |
@ -0,0 +1,45 @@
|
||||
body { |
||||
padding-top: 70px; |
||||
} |
||||
|
||||
.footer { |
||||
border-top: 1px solid #ddd; |
||||
margin-top: 30px; |
||||
padding-top: 15px; |
||||
padding-bottom: 30px; |
||||
} |
||||
|
||||
.jumbotron { |
||||
text-align: center; |
||||
background-color: transparent; |
||||
} |
||||
.jumbotron .btn { |
||||
font-size: 21px; |
||||
padding: 14px 24px; |
||||
} |
||||
|
||||
.not-set { |
||||
color: #c55; |
||||
font-style: italic; |
||||
} |
||||
|
||||
/* add sorting icons to gridview sort links */ |
||||
a.asc:after, a.desc:after { |
||||
position: relative; |
||||
top: 1px; |
||||
display: inline-block; |
||||
font-family: 'Glyphicons Halflings'; |
||||
font-style: normal; |
||||
font-weight: normal; |
||||
line-height: 1; |
||||
padding-left: 5px; |
||||
} |
||||
|
||||
a.asc:after { content: /*"\e113"*/"\e151"; } |
||||
a.desc:after { content: /*"\e114"*/"\e152"; } |
||||
|
||||
.sort-numerical a.asc:after { content: "\e153"; } |
||||
.sort-numerical a.desc:after { content: "\e154"; } |
||||
|
||||
.sort-ordinal a.asc:after { content: "\e155"; } |
||||
.sort-ordinal a.desc:after { content: "\e156"; } |
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,66 @@
|
||||
<?php |
||||
/** |
||||
* @link http://www.yiiframework.com/ |
||||
* @copyright Copyright (c) 2008 Yii Software LLC |
||||
* @license http://www.yiiframework.com/license/ |
||||
*/ |
||||
|
||||
namespace frontend\widgets; |
||||
|
||||
/** |
||||
* Alert widget renders a message from session flash. All flash messages are displayed |
||||
* in the sequence they were assigned using setFlash. You can set message as following: |
||||
* |
||||
* - \Yii::$app->getSession()->setFlash('error', 'This is the message'); |
||||
* - \Yii::$app->getSession()->setFlash('success', 'This is the message'); |
||||
* - \Yii::$app->getSession()->setFlash('info', 'This is the message'); |
||||
* |
||||
* @author Kartik Visweswaran <kartikv2@gmail.com> |
||||
* @author Alexander Makarov <sam@rmcerative.ru> |
||||
*/ |
||||
class Alert extends \yii\bootstrap\Widget |
||||
{ |
||||
/** |
||||
* @var array the alert types configuration for the flash messages. |
||||
* This array is setup as $key => $value, where: |
||||
* - $key is the name of the session flash variable |
||||
* - $value is the bootstrap alert type (i.e. danger, success, info, warning) |
||||
*/ |
||||
public $alertTypes = [ |
||||
'error' => 'danger', |
||||
'danger' => 'danger', |
||||
'success' => 'success', |
||||
'info' => 'info', |
||||
'warning' => 'warning' |
||||
]; |
||||
|
||||
/** |
||||
* @var array the options for rendering the close button tag. |
||||
*/ |
||||
public $closeButton = []; |
||||
|
||||
public function init() |
||||
{ |
||||
parent::init(); |
||||
|
||||
$session = \Yii::$app->getSession(); |
||||
$flashes = $session->getAllFlashes(); |
||||
$appendCss = isset($this->options['class']) ? ' ' . $this->options['class'] : ''; |
||||
|
||||
foreach ($flashes as $type => $message) { |
||||
/* initialize css class for each alert box */ |
||||
$this->options['class'] = 'alert-' . $this->alertTypes[$type] . $appendCss; |
||||
|
||||
/* assign unique id to each alert box */ |
||||
$this->options['id'] = $this->getId() . '-' . $type; |
||||
|
||||
echo \yii\bootstrap\Alert::widget([ |
||||
'body' => $message, |
||||
'closeButton' => $this->closeButton, |
||||
'options' => $this->options |
||||
]); |
||||
|
||||
$session->removeFlash($type); |
||||
} |
||||
} |
||||
} |
@ -1,78 +0,0 @@
|
||||
body { |
||||
padding-top: 20px; |
||||
padding-bottom: 60px; |
||||
} |
||||
|
||||
/* Custom container */ |
||||
.container { |
||||
margin: 0 auto; |
||||
max-width: 1000px; |
||||
} |
||||
|
||||
.container > hr { |
||||
margin: 60px 0; |
||||
} |
||||
|
||||
/* Main marketing message and sign up button */ |
||||
.jumbotron { |
||||
margin: 80px 0; |
||||
text-align: center; |
||||
} |
||||
|
||||
.jumbotron h1 { |
||||
font-size: 100px; |
||||
line-height: 1; |
||||
} |
||||
|
||||
.jumbotron .lead { |
||||
font-size: 24px; |
||||
line-height: 1.25; |
||||
} |
||||
|
||||
.jumbotron .btn { |
||||
font-size: 21px; |
||||
padding: 14px 24px; |
||||
} |
||||
|
||||
/* Supporting marketing content */ |
||||
.marketing { |
||||
margin: 60px 0; |
||||
} |
||||
|
||||
.marketing p + h4 { |
||||
margin-top: 28px; |
||||
} |
||||
|
||||
/* Customize the navbar links to be fill the entire space of the .navbar */ |
||||
.navbar .navbar-inner { |
||||
padding: 0; |
||||
} |
||||
|
||||
.navbar .nav { |
||||
margin: 0; |
||||
display: table; |
||||
width: 100%; |
||||
} |
||||
|
||||
.navbar .nav li { |
||||
display: table-cell; |
||||
width: 1%; |
||||
float: none; |
||||
} |
||||
|
||||
.navbar .nav li a { |
||||
font-weight: bold; |
||||
text-align: center; |
||||
border-left: 1px solid rgba(255, 255, 255, .75); |
||||
border-right: 1px solid rgba(0, 0, 0, .1); |
||||
} |
||||
|
||||
.navbar .nav li:first-child a { |
||||
border-left: 0; |
||||
border-radius: 3px 0 0 3px; |
||||
} |
||||
|
||||
.navbar .nav li:last-child a { |
||||
border-right: 0; |
||||
border-radius: 0 3px 3px 0; |
||||
} |
@ -0,0 +1,29 @@
|
||||
<?php |
||||
/** |
||||
* @link http://www.yiiframework.com/ |
||||
* @copyright Copyright (c) 2008 Yii Software LLC |
||||
* @license http://www.yiiframework.com/license/ |
||||
*/ |
||||
|
||||
namespace app\assets; |
||||
|
||||
use yii\web\AssetBundle; |
||||
|
||||
/** |
||||
* @author Qiang Xue <qiang.xue@gmail.com> |
||||
* @since 2.0 |
||||
*/ |
||||
class AppAsset extends AssetBundle |
||||
{ |
||||
public $basePath = '@webroot'; |
||||
public $baseUrl = '@web'; |
||||
public $css = [ |
||||
'css/site.css', |
||||
]; |
||||
public $js = [ |
||||
]; |
||||
public $depends = [ |
||||
'yii\web\YiiAsset', |
||||
'yii\bootstrap\BootstrapAsset', |
||||
]; |
||||
} |
@ -0,0 +1,18 @@
|
||||
paths: |
||||
tests: tests |
||||
log: tests/_log |
||||
data: tests/_data |
||||
helpers: tests/_helpers |
||||
settings: |
||||
bootstrap: _bootstrap.php |
||||
suite_class: \PHPUnit_Framework_TestSuite |
||||
memory_limit: 1024M |
||||
log: true |
||||
colors: true |
||||
modules: |
||||
config: |
||||
Db: |
||||
dsn: '' |
||||
user: '' |
||||
password: '' |
||||
dump: tests/_data/dump.sql |
@ -1,164 +0,0 @@
|
||||
{ |
||||
"_readme": [ |
||||
"This file locks the dependencies of your project to a known state", |
||||
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" |
||||
], |
||||
"hash": "91ba258de768b93025f86071f3bb4b84", |
||||
"packages": [ |
||||
{ |
||||
"name": "yiisoft/yii2", |
||||
"version": "dev-master", |
||||
"source": { |
||||
"type": "git", |
||||
"url": "https://github.com/yiisoft/yii2-framework.git", |
||||
"reference": "3ad6334be076a80df3b2ea0b57f38bd0c6901989" |
||||
}, |
||||
"dist": { |
||||
"type": "zip", |
||||
"url": "https://api.github.com/repos/yiisoft/yii2-framework/zipball/3ad6334be076a80df3b2ea0b57f38bd0c6901989", |
||||
"reference": "3ad6334be076a80df3b2ea0b57f38bd0c6901989", |
||||
"shasum": "" |
||||
}, |
||||
"require": { |
||||
"ext-mbstring": "*", |
||||
"lib-pcre": "*", |
||||
"php": ">=5.3.7" |
||||
}, |
||||
"suggest": { |
||||
"ezyang/htmlpurifier": "Required by HtmlPurifier.", |
||||
"michelf/php-markdown": "Required by Markdown.", |
||||
"smarty/smarty": "Required by SmartyViewRenderer.", |
||||
"twig/twig": "Required by TwigViewRenderer." |
||||
}, |
||||
"type": "library", |
||||
"autoload": { |
||||
"psr-0": { |
||||
"yii\\": "/" |
||||
} |
||||
}, |
||||
"notification-url": "https://packagist.org/downloads/", |
||||
"license": [ |
||||
"BSD-3-Clause" |
||||
], |
||||
"authors": [ |
||||
{ |
||||
"name": "Qiang Xue", |
||||
"email": "qiang.xue@gmail.com", |
||||
"homepage": "http://www.yiiframework.com/", |
||||
"role": "Founder and project lead" |
||||
}, |
||||
{ |
||||
"name": "Alexander Makarov", |
||||
"email": "sam@rmcreative.ru", |
||||
"homepage": "http://rmcreative.ru/", |
||||
"role": "Core framework development" |
||||
}, |
||||
{ |
||||
"name": "Maurizio Domba", |
||||
"homepage": "http://mdomba.info/", |
||||
"role": "Core framework development" |
||||
}, |
||||
{ |
||||
"name": "Carsten Brandt", |
||||
"email": "mail@cebe.cc", |
||||
"homepage": "http://cebe.cc/", |
||||
"role": "Core framework development" |
||||
}, |
||||
{ |
||||
"name": "Wei Zhuo", |
||||
"email": "weizhuo@gmail.com", |
||||
"role": "Project site maintenance and development" |
||||
}, |
||||
{ |
||||
"name": "Sebastián Thierer", |
||||
"email": "sebas@artfos.com", |
||||
"role": "Component development" |
||||
}, |
||||
{ |
||||
"name": "Jeffrey Winesett", |
||||
"email": "jefftulsa@gmail.com", |
||||
"role": "Documentation and marketing" |
||||
}, |
||||
{ |
||||
"name": "Timur Ruziev", |
||||
"email": "resurtm@gmail.com", |
||||
"homepage": "http://resurtm.com/", |
||||
"role": "Core framework development" |
||||
}, |
||||
{ |
||||
"name": "Paul Klimov", |
||||
"email": "klimov.paul@gmail.com", |
||||
"role": "Core framework development" |
||||
} |
||||
], |
||||
"description": "Yii2 Web Programming Framework", |
||||
"homepage": "http://www.yiiframework.com/", |
||||
"keywords": [ |
||||
"framework", |
||||
"yii" |
||||
], |
||||
"time": "2013-06-02 19:19:29" |
||||
}, |
||||
{ |
||||
"name": "yiisoft/yii2-composer", |
||||
"version": "dev-master", |
||||
"source": { |
||||
"type": "git", |
||||
"url": "https://github.com/yiisoft/yii2-composer.git", |
||||
"reference": "7ce4060faca940b836ab88de207638940a0a0568" |
||||
}, |
||||
"dist": { |
||||
"type": "zip", |
||||
"url": "https://api.github.com/repos/yiisoft/yii2-composer/zipball/7ce4060faca940b836ab88de207638940a0a0568", |
||||
"reference": "7ce4060faca940b836ab88de207638940a0a0568", |
||||
"shasum": "" |
||||
}, |
||||
"require": { |
||||
"yiisoft/yii2": "*" |
||||
}, |
||||
"type": "library", |
||||
"autoload": { |
||||
"psr-0": { |
||||
"yii\\composer": "" |
||||
} |
||||
}, |
||||
"notification-url": "https://packagist.org/downloads/", |
||||
"license": [ |
||||
"BSD-3-Clause" |
||||
], |
||||
"authors": [ |
||||
{ |
||||
"name": "Qiang Xue", |
||||
"email": "qiang.xue@gmail.com", |
||||
"homepage": "http://www.yiiframework.com/", |
||||
"role": "Founder and project lead" |
||||
} |
||||
], |
||||
"description": "The composer integration for the Yii framework", |
||||
"keywords": [ |
||||
"composer", |
||||
"install", |
||||
"update", |
||||
"yii" |
||||
], |
||||
"time": "2013-05-23 19:12:45" |
||||
} |
||||
], |
||||
"packages-dev": [ |
||||
|
||||
], |
||||
"aliases": [ |
||||
|
||||
], |
||||
"minimum-stability": "dev", |
||||
"stability-flags": { |
||||
"yiisoft/yii2": 20, |
||||
"yiisoft/yii2-composer": 20 |
||||
}, |
||||
"platform": { |
||||
"php": ">=5.3.0" |
||||
}, |
||||
"platform-dev": [ |
||||
|
||||
] |
||||
} |
@ -1,18 +0,0 @@
|
||||
<?php |
||||
|
||||
return array( |
||||
'app' => array( |
||||
'basePath' => '@wwwroot', |
||||
'baseUrl' => '@www', |
||||
'css' => array( |
||||
'css/site.css', |
||||
), |
||||
'js' => array( |
||||
|
||||
), |
||||
'depends' => array( |
||||
'yii', |
||||
'yii/bootstrap/responsive', |
||||
), |
||||
), |
||||
); |
@ -0,0 +1,11 @@
|
||||
<?php |
||||
|
||||
// configuration adjustments for codeception acceptance tests. Will be merged with web.php config. |
||||
|
||||
return [ |
||||
'components' => [ |
||||
'db' => [ |
||||
'dsn' => 'mysql:host=localhost;dbname=yii2basic_acceptance', |
||||
], |
||||
], |
||||
]; |
@ -0,0 +1,11 @@
|
||||
<?php |
||||
|
||||
// configuration adjustments for codeception functional tests. Will be merged with web.php config. |
||||
|
||||
return [ |
||||
'components' => [ |
||||
'db' => [ |
||||
'dsn' => 'mysql:host=localhost;dbname=yii2basic_functional', |
||||
], |
||||
], |
||||
]; |
@ -0,0 +1,15 @@
|
||||
<?php |
||||
|
||||
// configuration adjustments for codeception unit tests. Will be merged with web.php config. |
||||
|
||||
return [ |
||||
'components' => [ |
||||
'fixture' => [ |
||||
'class' => 'yii\test\DbFixtureManager', |
||||
'basePath' => '@tests/unit/fixtures', |
||||
], |
||||
'db' => [ |
||||
'dsn' => 'mysql:host=localhost;dbname=yii2basic_unit', |
||||
], |
||||
], |
||||
]; |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue