diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..3e9092c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +# Ignore all test and documentation for archive +/.github export-ignore +/.gitattributes export-ignore +/.scrutinizer.yml export-ignore +/.travis.yml export-ignore +/docs export-ignore diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..b092468 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,7 @@ +Contributing to Yii2 +==================== + +- [Report an issue](docs/internals/report-an-issue.md) +- [Translate documentation or messages](docs/internals/translation-workflow.md) +- [Give us feedback or start a design discussion](http://www.yiiframework.com/forum/index.php/forum/42-general-discussions-for-yii-20/) +- [Contribute to the core code or fix bugs](docs/internals/git-workflow.md) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..f37c867 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,13 @@ +### What steps will reproduce the problem? + +### What is expected? + +### What do you get instead? + +### Additional info + +| Question | Answer +| ---------------- | ---------------- +| Yii version | +| PHP version | +| Operating system | diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..bdd0016 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,7 @@ +| Question | Answer +| ------------- | ------------- +| Is bugfix? | yes/no +| New feature? | yes/no +| Breaks BC? | yes/no +| Tests pass? | yes/no +| Fixed issues | comma-separated list of tickets # fixed by the PR, if any diff --git a/.htaccess b/.htaccess index 1298e9f..e4de940 100644 --- a/.htaccess +++ b/.htaccess @@ -1,8 +1,8 @@ # ---------------------------------------------------------------------- # Adds some security for the Apache server configuration for use with -# yii2-app-practical-b template. +# https://github.com/kartik-v/yii2-app-practical-b template. # @author Kartik Visweswaran -# @see http://demos.krajee.com/app-practical +# @see http://demos.krajee.com/app-practical-b # ---------------------------------------------------------------------- # "-Indexes" will have Apache block users from browsing folders without a default document @@ -23,7 +23,7 @@ # Block access to backup and source files -# This files may be left by some text/html editors and +# These files may be left by some text/html editors and # pose a great security danger, when someone can access them Order allow,deny diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..24b5d54 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,37 @@ +language: php + +php: + - 5.4 + - 5.5 + - 5.6 + - 7.0 +# - hhvm + +# faster builds on new travis setup not using sudo +sudo: false + +# cache vendor dirs +cache: + directories: + - $HOME/.composer/cache + +install: + - travis_retry composer self-update && composer --version + - travis_retry composer global require "fxp/composer-asset-plugin:~1.1.1" + - export PATH="$HOME/.composer/vendor/bin:$PATH" + - travis_retry composer install --dev --prefer-dist --no-interaction +# codeception + - travis_retry composer global require "codeception/codeception=2.0.*" "codeception/specify=*" "codeception/verify=*" +# setup application: + - | + sed -i "s/'cookieValidationKey' => ''/'cookieValidationKey' => 'testkey'/" config/web.php + cd tests + codecept build + cd .. + +script: + - | + cd web + php -S localhost:8080 > /dev/null 2>&1 & + cd ../tests + codecept run diff --git a/CHANGE.md b/CHANGE.md index 7122502..1144c9c 100644 --- a/CHANGE.md +++ b/CHANGE.md @@ -3,9 +3,10 @@ Change Log: `yii2-app-practical-b` ## Version 1.6.2 -**Date:** 2015-08-17 +**Date:** 2016-04-08 - Updates to `composer.json` and `.gitignore`. +- Update to latest yii2-basic-app as of 08-Apr-2016. ## Version 1.6.1 diff --git a/README.md b/README.md index e19c5cb..8cdcbe2 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,15 @@ a directory named `practical-b` that is directly under the Web root. extract the [yii2-basic vendor folder from here](https://github.com/yiisoft/yii2/releases/download/2.0.0/yii-basic-app-2.0.0.tgz). Then you must copy this folder directly under the app root (i.e. `practical-b` directory). +Set cookie validation key in `config/web.php` file to some random secret string: + +```php +'request' => [ + // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation + 'cookieValidationKey' => '', +], +``` + You can then access the application through the following URL: ~~~ @@ -133,6 +142,7 @@ return [ ]; ``` -**NOTE:** Yii won't create the database for you, this has to be done manually before you can access it. - -Also check and edit the other files in the `config/` directory to customize your application. \ No newline at end of file +**NOTES:** +- Yii won't create the database for you, this has to be done manually before you can access it. +- Check and edit the other files in the `config/` directory to customize your application as required. +- Refer to the README in the `tests` directory for information specific to basic application tests. \ No newline at end of file diff --git a/composer.json b/composer.json index d4d2c84..b238c39 100644 --- a/composer.json +++ b/composer.json @@ -13,13 +13,16 @@ } ], "support": { - "issues": "https://github.com/kartik-v/yii2-app-practical-b/issues?state=open", - "source": "https://github.com/kartik-v/yii2-app-practical-b/" - }, + "issues": "https://github.com/yiisoft/yii2/issues?state=open", + "forum": "http://www.yiiframework.com/forum/", + "wiki": "http://www.yiiframework.com/wiki/", + "irc": "irc://irc.freenode.net/yii", + "source": "https://github.com/yiisoft/yii2" + }, "minimum-stability": "dev", "require": { "php": ">=5.4.0", - "yiisoft/yii2": "*", + "yiisoft/yii2": ">=2.0.5", "yiisoft/yii2-bootstrap": "*", "yiisoft/yii2-swiftmailer": "*" }, @@ -42,7 +45,7 @@ "setPermission": [ { "runtime": "0777", - "assets": "0777", + "web/assets": "0777", "yii": "0755" } ], diff --git a/config/console.php b/config/console.php index 27e8565..7306e27 100644 --- a/config/console.php +++ b/config/console.php @@ -1,18 +1,15 @@ 'basic-console', 'basePath' => dirname(__DIR__), - 'bootstrap' => ['log', 'gii'], + 'bootstrap' => ['log'], 'controllerNamespace' => 'app\commands', - 'modules' => [ - 'gii' => 'yii\gii\Module', - ], 'components' => [ 'cache' => [ 'class' => 'yii\caching\FileCache', @@ -28,4 +25,21 @@ 'db' => $db, ], 'params' => $params, -]; \ No newline at end of file + /* + 'controllerMap' => [ + 'fixture' => [ // Fixture generation command line. + 'class' => 'yii\faker\FixtureController', + ], + ], + */ +]; + +if (YII_ENV_DEV) { + // configuration adjustments for 'dev' environment + $config['bootstrap'][] = 'gii'; + $config['modules']['gii'] = [ + 'class' => 'yii\gii\Module', + ]; +} + +return $config; diff --git a/config/web.php b/config/web.php index 1262ae4..38f515e 100644 --- a/config/web.php +++ b/config/web.php @@ -49,10 +49,14 @@ if (YII_ENV_DEV) { // configuration adjustments for 'dev' environment $config['bootstrap'][] = 'debug'; - $config['modules']['debug'] = 'yii\debug\Module'; + $config['modules']['debug'] = [ + 'class' => 'yii\debug\Module', + ]; $config['bootstrap'][] = 'gii'; - $config['modules']['gii'] = 'yii\gii\Module'; + $config['modules']['gii'] = [ + 'class' => 'yii\gii\Module', + ]; } return $config; \ No newline at end of file diff --git a/requirements.php b/requirements.php index 436fdfd..ee3184f 100644 --- a/requirements.php +++ b/requirements.php @@ -85,12 +85,6 @@ 'by' => 'MemCache', 'memo' => extension_loaded('memcached') ? 'To use memcached set MemCache::useMemcached to true.' : '' ), - array( - 'name' => 'APC extension', - 'mandatory' => false, - 'condition' => extension_loaded('apc'), - 'by' => 'ApcCache', - ), // CAPTCHA: array( 'name' => 'GD PHP extension with FreeType support', @@ -107,13 +101,6 @@ 'memo' => $imagickMemo, ), // PHP ini : - 'phpSafeMode' => array( - 'name' => 'PHP safe mode', - 'mandatory' => false, - 'condition' => $requirementsChecker->checkPhpIniOff("safe_mode"), - 'by' => 'File uploading and console command execution', - 'memo' => '"safe_mode" should be disabled at php.ini', - ), 'phpExposePhp' => array( 'name' => 'Expose PHP', 'mandatory' => false, @@ -131,9 +118,20 @@ 'phpSmtp' => array( 'name' => 'PHP mail SMTP', 'mandatory' => false, - 'condition' => strlen(ini_get('SMTP'))>0, + 'condition' => strlen(ini_get('SMTP')) > 0, 'by' => 'Email sending', 'memo' => 'PHP mail SMTP server required', ), ); -$requirementsChecker->checkYii()->check($requirements)->render(); \ No newline at end of file + +// OPcache check +if (!version_compare(phpversion(), '5.5', '>=')) { + $requirements[] = array( + 'name' => 'APC extension', + 'mandatory' => false, + 'condition' => extension_loaded('apc'), + 'by' => 'ApcCache', + ); +} + +$requirementsChecker->checkYii()->check($requirements)->render(); diff --git a/tests/README.md b/tests/README.md index f4c1663..fd80fe5 100644 --- a/tests/README.md +++ b/tests/README.md @@ -24,7 +24,7 @@ After creating the basic application, follow these steps to prepare for the test 2. Install faker extension by running the following from template root directory where `composer.json` is: ``` - composer require --dev yiisoft/yii2-faker:* + composer require --dev "yiisoft/yii2-faker:*" ``` 3. Create `yii2_basic_tests` database and update it by applying migrations (you may skip this step if you do not have created any migrations yet): @@ -33,6 +33,9 @@ After creating the basic application, follow these steps to prepare for the test codeception/bin/yii migrate ``` + The command needs to be run in the `tests` directory. + The database configuration can be found at `tests/codeception/config/config.php`. + 4. Build the test suites: ``` @@ -59,6 +62,17 @@ webserver. In the `web` directory execute the following: codecept run unit ``` +Fixtures Default Configuration +------------------------------ +The `fixture` commands refer to the following `ActiveFixture` configuration by default: + +- Fixtures path: `@tests/unit/fixtures` +- Fixtures data path: `@tests/unit/fixtures/data` +- Template files path: `@tests/unit/templates/fixtures` +- Namespace: `tests\unit\fixtures` + +Where `@tests` refers to `@app/tests/codeception`. + Code coverage support --------------------- @@ -90,6 +104,8 @@ from codeception site. 3. include `c3.php` file in your `index-test.php` file before application run, so it can catch needed requests. +4. edit `c3.php` to update config file path (~ line 55) with `$config_file = realpath(__DIR__ . '/../tests/codeception.yml');` + Configuration options that are used by remote code coverage: - c3_url: url pointing to entry script that includes `c3.php` file, so `Codeception` will be able to produce code coverage; @@ -108,4 +124,4 @@ codecept run acceptance --coverage-html --coverage-xml ``` Please refer to [Codeception tutorial](http://codeception.com/docs/01-Introduction) for -more details about writing and running acceptance, functional and unit tests. \ No newline at end of file +more details about writing and running acceptance, functional and unit tests. diff --git a/tests/codeception/_bootstrap.php b/tests/codeception/_bootstrap.php index 6de621b..755029e 100644 --- a/tests/codeception/_bootstrap.php +++ b/tests/codeception/_bootstrap.php @@ -3,7 +3,7 @@ defined('YII_ENV') or define('YII_ENV', 'test'); defined('YII_TEST_ENTRY_URL') or define('YII_TEST_ENTRY_URL', parse_url(\Codeception\Configuration::config()['config']['test_entry_url'], PHP_URL_PATH)); -defined('YII_TEST_ENTRY_FILE') or define('YII_TEST_ENTRY_FILE', dirname(dirname(__DIR__)) . '/index-test.php'); +defined('YII_TEST_ENTRY_FILE') or define('YII_TEST_ENTRY_FILE', dirname(dirname(__DIR__)) . '/web/index-test.php'); require_once(__DIR__ . '/../../vendor/autoload.php'); require_once(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php'); @@ -13,4 +13,4 @@ $_SERVER['SERVER_NAME'] = parse_url(\Codeception\Configuration::config()['config']['test_entry_url'], PHP_URL_HOST); $_SERVER['SERVER_PORT'] = parse_url(\Codeception\Configuration::config()['config']['test_entry_url'], PHP_URL_PORT) ?: '80'; -Yii::setAlias('@tests', dirname(__DIR__)); \ No newline at end of file +Yii::setAlias('@tests', dirname(__DIR__)); diff --git a/tests/codeception/acceptance/AboutCept.php b/tests/codeception/acceptance/AboutCept.php index 9433277..88a5506 100644 --- a/tests/codeception/acceptance/AboutCept.php +++ b/tests/codeception/acceptance/AboutCept.php @@ -2,7 +2,9 @@ use tests\codeception\_pages\AboutPage; +/* @var $scenario Codeception\Scenario */ + $I = new AcceptanceTester($scenario); $I->wantTo('ensure that about works'); AboutPage::openBy($I); -$I->see('About', 'h1'); \ No newline at end of file +$I->see('About', 'h1'); diff --git a/tests/codeception/acceptance/ContactCept.php b/tests/codeception/acceptance/ContactCept.php index 2fcae88..f848443 100644 --- a/tests/codeception/acceptance/ContactCept.php +++ b/tests/codeception/acceptance/ContactCept.php @@ -2,6 +2,8 @@ use tests\codeception\_pages\ContactPage; +/* @var $scenario Codeception\Scenario */ + $I = new AcceptanceTester($scenario); $I->wantTo('ensure that contact works'); @@ -11,6 +13,9 @@ $I->amGoingTo('submit contact form with no data'); $contactPage->submit([]); +if (method_exists($I, 'wait')) { + $I->wait(3); // only for selenium +} $I->expectTo('see validations errors'); $I->see('Contact', 'h1'); $I->see('Name cannot be blank'); @@ -27,7 +32,10 @@ 'body' => 'test content', 'verifyCode' => 'testme', ]); -$I->expectTo('see that email adress is wrong'); +if (method_exists($I, 'wait')) { + $I->wait(3); // only for selenium +} +$I->expectTo('see that email address is wrong'); $I->dontSee('Name cannot be blank', '.help-inline'); $I->see('Email is not a valid email address.'); $I->dontSee('Subject cannot be blank', '.help-inline'); @@ -46,4 +54,4 @@ $I->wait(3); // only for selenium } $I->dontSeeElement('#contact-form'); -$I->see('Thank you for contacting us. We will respond to you as soon as possible.'); \ No newline at end of file +$I->see('Thank you for contacting us. We will respond to you as soon as possible.'); diff --git a/tests/codeception/acceptance/HomeCept.php b/tests/codeception/acceptance/HomeCept.php index c06997a..1f93535 100644 --- a/tests/codeception/acceptance/HomeCept.php +++ b/tests/codeception/acceptance/HomeCept.php @@ -1,9 +1,11 @@ wantTo('ensure that home page works'); $I->amOnPage(Yii::$app->homeUrl); $I->see('My Company'); $I->seeLink('About'); $I->click('About'); -$I->see('This is the About page.'); \ No newline at end of file +$I->see('This is the About page.'); diff --git a/tests/codeception/acceptance/LoginCept.php b/tests/codeception/acceptance/LoginCept.php index 87305f7..90d0635 100644 --- a/tests/codeception/acceptance/LoginCept.php +++ b/tests/codeception/acceptance/LoginCept.php @@ -2,6 +2,8 @@ use tests\codeception\_pages\LoginPage; +/* @var $scenario Codeception\Scenario */ + $I = new AcceptanceTester($scenario); $I->wantTo('ensure that login works'); @@ -11,6 +13,9 @@ $I->amGoingTo('try to login with empty credentials'); $loginPage->login('', ''); +if (method_exists($I, 'wait')) { + $I->wait(3); // only for selenium +} $I->expectTo('see validations errors'); $I->see('Username cannot be blank.'); $I->see('Password cannot be blank.'); @@ -29,4 +34,4 @@ $I->wait(3); // only for selenium } $I->expectTo('see user info'); -$I->see('Logout (admin)'); \ No newline at end of file +$I->see('Logout (admin)'); diff --git a/tests/codeception/acceptance/_bootstrap.php b/tests/codeception/acceptance/_bootstrap.php index 7c3ed60..36f9f1d 100644 --- a/tests/codeception/acceptance/_bootstrap.php +++ b/tests/codeception/acceptance/_bootstrap.php @@ -1,2 +1,2 @@ [ - 'fixture' => [ - 'class' => 'yii\faker\FixtureController', - 'fixtureDataPath' => '@tests/codeception/fixtures', - 'templatePath' => '@tests/codeception/templates', - 'namespace' => 'tests\codeception\fixtures', - ], - ], - ] + require(__DIR__ . '/../config/config.php') ); $application = new yii\console\Application($config); diff --git a/tests/codeception/config/config.php b/tests/codeception/config/config.php index bac901d..d4e1f77 100644 --- a/tests/codeception/config/config.php +++ b/tests/codeception/config/config.php @@ -3,6 +3,15 @@ * Application configuration shared by all test types */ return [ + 'language' => 'en-US', + 'controllerMap' => [ + 'fixture' => [ + 'class' => 'yii\faker\FixtureController', + 'fixtureDataPath' => '@tests/codeception/fixtures', + 'templatePath' => '@tests/codeception/templates', + 'namespace' => 'tests\codeception\fixtures', + ], + ], 'components' => [ 'db' => [ 'dsn' => 'mysql:host=localhost;dbname=yii2_basic_tests', diff --git a/tests/codeception/functional/AboutCept.php b/tests/codeception/functional/AboutCept.php index 9bb3b86..0926061 100644 --- a/tests/codeception/functional/AboutCept.php +++ b/tests/codeception/functional/AboutCept.php @@ -2,7 +2,9 @@ use tests\codeception\_pages\AboutPage; +/* @var $scenario Codeception\Scenario */ + $I = new FunctionalTester($scenario); $I->wantTo('ensure that about works'); AboutPage::openBy($I); -$I->see('About', 'h1'); \ No newline at end of file +$I->see('About', 'h1'); diff --git a/tests/codeception/functional/ContactCept.php b/tests/codeception/functional/ContactCept.php index 9a958b3..b17a757 100644 --- a/tests/codeception/functional/ContactCept.php +++ b/tests/codeception/functional/ContactCept.php @@ -2,6 +2,8 @@ use tests\codeception\_pages\ContactPage; +/* @var $scenario Codeception\Scenario */ + $I = new FunctionalTester($scenario); $I->wantTo('ensure that contact works'); @@ -27,7 +29,7 @@ 'body' => 'test content', 'verifyCode' => 'testme', ]); -$I->expectTo('see that email adress is wrong'); +$I->expectTo('see that email address is wrong'); $I->dontSee('Name cannot be blank', '.help-inline'); $I->see('Email is not a valid email address.'); $I->dontSee('Subject cannot be blank', '.help-inline'); @@ -43,4 +45,4 @@ 'verifyCode' => 'testme', ]); $I->dontSeeElement('#contact-form'); -$I->see('Thank you for contacting us. We will respond to you as soon as possible.'); \ No newline at end of file +$I->see('Thank you for contacting us. We will respond to you as soon as possible.'); diff --git a/tests/codeception/functional/HomeCept.php b/tests/codeception/functional/HomeCept.php index d809bb8..94efb09 100644 --- a/tests/codeception/functional/HomeCept.php +++ b/tests/codeception/functional/HomeCept.php @@ -1,9 +1,11 @@ wantTo('ensure that home page works'); $I->amOnPage(Yii::$app->homeUrl); $I->see('My Company'); $I->seeLink('About'); $I->click('About'); -$I->see('This is the About page.'); \ No newline at end of file +$I->see('This is the About page.'); diff --git a/tests/codeception/functional/LoginCept.php b/tests/codeception/functional/LoginCept.php index a918dd6..66e7609 100644 --- a/tests/codeception/functional/LoginCept.php +++ b/tests/codeception/functional/LoginCept.php @@ -2,6 +2,8 @@ use tests\codeception\_pages\LoginPage; +/* @var $scenario Codeception\Scenario */ + $I = new FunctionalTester($scenario); $I->wantTo('ensure that login works'); @@ -23,4 +25,4 @@ $I->amGoingTo('try to login with correct credentials'); $loginPage->login('admin', 'admin'); $I->expectTo('see user info'); -$I->see('Logout (admin)'); \ No newline at end of file +$I->see('Logout (admin)'); diff --git a/tests/codeception/functional/_bootstrap.php b/tests/codeception/functional/_bootstrap.php index 2d37fc2..8aac091 100644 --- a/tests/codeception/functional/_bootstrap.php +++ b/tests/codeception/functional/_bootstrap.php @@ -1,2 +1,2 @@ beginPage() ?> @@ -21,49 +22,57 @@ head() ?> - beginBody() ?> -
- 'My Company', - 'brandUrl' => Yii::$app->homeUrl, - 'options' => [ - 'class' => 'navbar-inverse navbar-fixed-top', - ], - ]); - echo Nav::widget([ - 'options' => ['class' => 'navbar-nav navbar-right'], - 'items' => [ - ['label' => 'Home', 'url' => ['/site/index']], - ['label' => 'About', 'url' => ['/site/about']], - ['label' => 'Contact', 'url' => ['/site/contact']], - Yii::$app->user->isGuest ? - ['label' => 'Login', 'url' => ['/site/login']] : - ['label' => 'Logout (' . Yii::$app->user->identity->username . ')', - 'url' => ['/site/logout'], - 'linkOptions' => ['data-method' => 'post']], - ], - ]); - NavBar::end(); - ?> -
- isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], - ]) ?> - -
+
+ 'My Company', + 'brandUrl' => Yii::$app->homeUrl, + 'options' => [ + 'class' => 'navbar-inverse navbar-fixed-top', + ], + ]); + echo Nav::widget([ + 'options' => ['class' => 'navbar-nav navbar-right'], + 'items' => [ + ['label' => 'Home', 'url' => ['/site/index']], + ['label' => 'About', 'url' => ['/site/about']], + ['label' => 'Contact', 'url' => ['/site/contact']], + Yii::$app->user->isGuest ? ( + ['label' => 'Login', 'url' => ['/site/login']] + ) : ( + '
  • ' + . Html::beginForm(['/site/logout'], 'post', ['class' => 'navbar-form']) + . Html::submitButton( + 'Logout (' . Yii::$app->user->identity->username . ')', + ['class' => 'btn btn-link'] + ) + . Html::endForm() + . '
  • ' + ) + ], + ]); + NavBar::end(); + ?> + +
    + isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], + ]) ?> +
    +
    -
    -
    -

    © My Company

    -

    -
    -
    +
    +
    +

    © My Company

    + +

    +
    +
    endBody() ?> -endPage() ?> \ No newline at end of file +endPage() ?> diff --git a/views/site/contact.php b/views/site/contact.php index f90a51b..b988409 100644 --- a/views/site/contact.php +++ b/views/site/contact.php @@ -1,12 +1,13 @@ title = 'Contact'; $this->params['breadcrumbs'][] = $this->title; ?> @@ -15,43 +16,53 @@ session->hasFlash('contactFormSubmitted')): ?> -
    - Thank you for contacting us. We will respond to you as soon as possible. -
    - -

    - Note that if you turn on the Yii debugger, you should be able - to view the mail message on the mail panel of the debugger. - mailer->useFileTransport): ?> - Because the application is in development mode, the email is not sent but saved as - a file under mailer->fileTransportPath) ?>. - Please configure the useFileTransport property of the mail - application component to be false to enable email sending. - -

    +
    + Thank you for contacting us. We will respond to you as soon as possible. +
    + +

    + Note that if you turn on the Yii debugger, you should be able + to view the mail message on the mail panel of the debugger. + mailer->useFileTransport): ?> + Because the application is in development mode, the email is not sent but saved as + a file under mailer->fileTransportPath) ?>. + Please configure the useFileTransport property of the mail + application component to be false to enable email sending. + +

    -

    - If you have business inquiries or other questions, please fill out the following form to contact us. Thank you. -

    - -
    -
    - 'contact-form']); ?> - field($model, 'name') ?> - field($model, 'email') ?> - field($model, 'subject') ?> - field($model, 'body')->textArea(['rows' => 6]) ?> - field($model, 'verifyCode')->widget(Captcha::className(), [ - 'template' => '
    {image}
    {input}
    ', - ]) ?> -
    - 'btn btn-primary', 'name' => 'contact-button']) ?> -
    - +

    + If you have business inquiries or other questions, please fill out the following form to contact us. + Thank you. +

    + +
    +
    + + 'contact-form']); ?> + + field($model, 'name')->textInput(['autofocus' => true]) ?> + + field($model, 'email') ?> + + field($model, 'subject') ?> + + field($model, 'body')->textArea(['rows' => 6]) ?> + + field($model, 'verifyCode')->widget(Captcha::className(), [ + 'template' => '
    {image}
    {input}
    ', + ]) ?> + +
    + 'btn btn-primary', 'name' => 'contact-button']) ?> +
    + + + +
    -
    -
    \ No newline at end of file +
    diff --git a/views/site/login.php b/views/site/login.php index c361d67..498f46f 100644 --- a/views/site/login.php +++ b/views/site/login.php @@ -1,11 +1,12 @@ title = 'Login'; $this->params['breadcrumbs'][] = $this->title; ?> @@ -23,19 +24,19 @@ ], ]); ?> - field($model, 'username') ?> + field($model, 'username')->textInput(['autofocus' => true]) ?> - field($model, 'password')->passwordInput() ?> + field($model, 'password')->passwordInput() ?> - field($model, 'rememberMe')->checkbox([ - 'template' => "
    {input} {label}
    \n
    {error}
    ", - ]) ?> + field($model, 'rememberMe')->checkbox([ + 'template' => "
    {input} {label}
    \n
    {error}
    ", + ]) ?> -
    -
    - 'btn btn-primary', 'name' => 'login-button']) ?> +
    +
    + 'btn btn-primary', 'name' => 'login-button']) ?> +
    -
    @@ -43,4 +44,4 @@ You may login with admin/admin or demo/demo.
    To modify the username/password, please check out the code app\models\User::$users.
    - \ No newline at end of file + diff --git a/yii b/yii index b032ebd..fc7090f 100644 --- a/yii +++ b/yii @@ -9,10 +9,7 @@ */ defined('YII_DEBUG') or define('YII_DEBUG', true); - -// fcgi doesn't have STDIN and STDOUT defined by default -defined('STDIN') or define('STDIN', fopen('php://stdin', 'r')); -defined('STDOUT') or define('STDOUT', fopen('php://stdout', 'w')); +defined('YII_ENV') or define('YII_ENV', 'dev'); require(__DIR__ . '/vendor/autoload.php'); require(__DIR__ . '/vendor/yiisoft/yii2/Yii.php');