diff --git a/.gitignore b/.gitignore index 9291d3e..832a890 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,4 @@ nbproject Thumbs.db # composer vendor dir -vendor \ No newline at end of file +/yii/vendor \ No newline at end of file diff --git a/apps/bootstrap/index.php b/apps/bootstrap/index.php index e3188c1..a0488ca 100644 --- a/apps/bootstrap/index.php +++ b/apps/bootstrap/index.php @@ -1,8 +1,13 @@ 'hello', 'basePath' => dirname(__DIR__), + 'preload' => array('log'), + 'modules' => array( + 'debug' => array( + 'class' => 'yii\debug\Module', + ) + ), 'components' => array( 'cache' => array( 'class' => 'yii\caching\FileCache', @@ -14,6 +20,15 @@ return array( 'assetManager' => array( 'bundles' => require(__DIR__ . '/assets.php'), ), + 'log' => array( + 'class' => 'yii\logging\Router', + 'targets' => array( + 'file' => array( + 'class' => 'yii\logging\FileTarget', + 'levels' => array('error', 'warning'), + ), + ), + ), ), 'params' => array( 'adminEmail' => 'admin@example.com', diff --git a/apps/bootstrap/protected/controllers/SiteController.php b/apps/bootstrap/protected/controllers/SiteController.php index d1186f6..b06ed06 100644 --- a/apps/bootstrap/protected/controllers/SiteController.php +++ b/apps/bootstrap/protected/controllers/SiteController.php @@ -6,6 +6,15 @@ use app\models\ContactForm; class SiteController extends Controller { + public function actions() + { + return array( + 'captcha' => array( + 'class' => 'yii\web\CaptchaAction', + ), + ); + } + public function actionIndex() { echo $this->render('index'); diff --git a/apps/bootstrap/protected/models/ContactForm.php b/apps/bootstrap/protected/models/ContactForm.php index 5124b2c..7b713a1 100644 --- a/apps/bootstrap/protected/models/ContactForm.php +++ b/apps/bootstrap/protected/models/ContactForm.php @@ -26,7 +26,7 @@ class ContactForm extends Model // email has to be a valid email address array('email', 'email'), // verifyCode needs to be entered correctly - //array('verifyCode', 'captcha', 'allowEmpty' => !Captcha::checkRequirements()), + array('verifyCode', 'captcha'), ); } diff --git a/apps/bootstrap/protected/views/layouts/main.php b/apps/bootstrap/protected/views/layouts/main.php index 1240053..a81f983 100644 --- a/apps/bootstrap/protected/views/layouts/main.php +++ b/apps/bootstrap/protected/views/layouts/main.php @@ -1,9 +1,11 @@ registerAssetBundle('app'); ?> beginPage(); ?> @@ -23,16 +25,17 @@ $this->registerAssetBundle('app');
@@ -55,6 +58,7 @@ $this->registerAssetBundle('app'); endBody(); ?> +widget('yii\debug\Toolbar'); ?>