1. 安裝架構
php composer.phar create-project phpixie/project your_project_folder
2.設定路徑
原文:And here are rules for Apache2 (put into .htaccess in project root
folder):
RewriteEngine onRewriteBase /RewriteCond %{REQUEST_URI} !web/RewriteRule (.*) /web/$1 [L]我把apache的localhost指向了 localhost/phpixie/web,同時把上面的.htaccess塞在了phpixie路徑下(根目錄)。
這時候訪問http://localhost 可以得到phpixie的歡迎介面
3. 配置一個控制器
// bundles/app/src/Project/App/HTTPProcessors/Quickstart.php
namespace Project\App\HTTPProcessors;
use PHPixie\HTTP\Request;
// we extend a class that allows Controller-like behavior
class Quickstart extends \PHPixie\DefaultBundle\Processor\HTTP\Actions
{
/**
The Builder will be used to access
various parts of the framework later on
@var Project\App\HTTPProcessors\Builder
*/
$builder;
function __construct($builder)
{
$this->builder = $builder;
}
// This is the default action
function defaultAction(Request $request)
{
return "Quickstart tutorial";
}
//We will be adding methods here in a moment
}
// bundles/app/src/Project/App/HTTPProcessor.php//... protected function buildQuickstartProcessor() { return new HTTPProcessors\Quickstart( $this->builder ); }//...然後訪問 **http://localhost/quickstart/** 卻發現是404
求大神賜教我是哪裡配置錯了???
原文地址:http://www.phpixie.com/quickstart.html
回複內容:
1. 安裝架構
php composer.phar create-project phpixie/project your_project_folder
2.設定路徑
原文:And here are rules for Apache2 (put into .htaccess in project root
folder):
RewriteEngine onRewriteBase /RewriteCond %{REQUEST_URI} !web/RewriteRule (.*) /web/$1 [L]我把apache的localhost指向了 localhost/phpixie/web,同時把上面的.htaccess塞在了phpixie路徑下(根目錄)。
這時候訪問http://localhost 可以得到phpixie的歡迎介面
3. 配置一個控制器
// bundles/app/src/Project/App/HTTPProcessors/Quickstart.php
namespace Project\App\HTTPProcessors;
use PHPixie\HTTP\Request;
// we extend a class that allows Controller-like behavior
class Quickstart extends \PHPixie\DefaultBundle\Processor\HTTP\Actions
{
/**
The Builder will be used to access
various parts of the framework later on
@var Project\App\HTTPProcessors\Builder
*/
$builder;
function __construct($builder)
{
$this->builder = $builder;
}
// This is the default action
function defaultAction(Request $request)
{
return "Quickstart tutorial";
}
//We will be adding methods here in a moment
}
// bundles/app/src/Project/App/HTTPProcessor.php//... protected function buildQuickstartProcessor() { return new HTTPProcessors\Quickstart( $this->builder ); }//...然後訪問 **http://localhost/quickstart/** 卻發現是404
求大神賜教我是哪裡配置錯了???
原文地址:http://www.phpixie.com/quickstart.html