1. install framework {code ...} 2. original path: AndherearerulesforApache2 (putinto. htaccessinprojectrootfolder): {code ...} in this case, access localhost to get the welcome page of phpixie. 3. configure a controller...
1. Install the framework
php composer.phar create-project phpixie/project your_project_folder
2. Set the path
Original article: And here are rules for Apache2 (put into. htaccess in project root
Folder ):
RewriteEngine onRewriteBase/RewriteCond % {REQUEST_URI }! Web/RewriteRule (. *)/web/$1 [L] I direct apache localhost to localhost/phpixie/web, and set the above. the htaccess plug is in the phpixie path (root directory ).
AccessHttp: // localhostYou can get a welcome page for phpixie.
3. configure a controller
// 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 );}//... then access ** http: // localhost/quickstart/**, but the result is 404.
Could you please kindly advise me where the configuration is wrong ???
Original article address:Http://www.phpixie.com/quickstart.html
Reply content:
1. Install the framework
php composer.phar create-project phpixie/project your_project_folder
2. Set the path
Original article: And here are rules for Apache2 (put into. htaccess in project root
Folder ):
RewriteEngine onRewriteBase/RewriteCond % {REQUEST_URI }! Web/RewriteRule (. *)/web/$1 [L] I direct apache localhost to localhost/phpixie/web, and set the above. the htaccess plug is in the phpixie path (root directory ).
AccessHttp: // localhostYou can get a welcome page for phpixie.
3. configure a controller
// 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 );}//... then access ** http: // localhost/quickstart/**, but the result is 404.
Could you please kindly advise me where the configuration is wrong ???
Original article address:Http://www.phpixie.com/quickstart.html