renamed create -> webapp/create, specified global options

This commit is contained in:
Alexander Makarov
2013-02-20 00:30:02 +04:00
parent 63cb47e1f5
commit a25f870090
8 changed files with 75 additions and 7 deletions

View File

@@ -0,0 +1,17 @@
<?php
/** @var $controller \yii\console\controllers\WebappController */
$controller = $this;
return array(
'default' => array(
'index.php' => array(
'handler' => function($source) use ($controller) {
return $controller->replaceRelativePath($source, realpath(YII_PATH.'/yii.php'), 'yii');
},
'permissions' => 0777,
),
'protected/runtime' => array(
'permissions' => 0755,
),
),
);

View File

@@ -0,0 +1,10 @@
<?php
define('YII_DEBUG', true);
$yii = __DIR__.'/../framework/yii.php';
require $yii;
$config = require dirname(__DIR__).'/protected/config/main.php';
$basePath = dirname(__DIR__).'/protected';
$app = new \yii\web\Application('webapp', $basePath, $config);
$app->run();

View File

@@ -0,0 +1,16 @@
<?php
return array(
'name' => 'My Web Application',
'components' => array(
// uncomment the following to use a MySQL database
/*
'db' => array(
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=testdrive',
'username' => 'root',
'password' => '',
),
*/
),
);

View File

@@ -0,0 +1,15 @@
<?php
use \yii\web\Controller;
/**
* SiteController
*/
class SiteController extends Controller
{
public function actionIndex()
{
echo $this->render('index', array(
'name' => 'Qiang',
));
}
}

View File

@@ -0,0 +1,16 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title><?php echo $this->context->pageTitle?></title>
</head>
<body>
<h1><?php echo $this->context->pageTitle?></h1>
<div class="content">
<?php echo $content?>
</div>
<div class="footer">
<?php echo \Yii::powered()?>
</div>
</body>
</html>

View File

@@ -0,0 +1 @@
Hello, <?php echo $name?>!