Php framework-a PHPixie framework

Source: Internet
Author: User
Tags php framework
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
      */

    1. $ Builder;

    2. Function _ construct ($ builder)
      {

         $this->builder = $builder;

      }

      // This is the default action

    3. 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
      */

    1. $ Builder;

    2. Function _ construct ($ builder)
      {

         $this->builder = $builder;

      }

      // This is the default action

    3. 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

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.