PHP Framework-A problem with the Phpixie framework

Source: Internet
Author: User
Tags php framework
1. Installation Framework

php composer.phar create-project phpixie/project your_project_folder

2. Setting the path

Original: And here is rules for Apache2 (put to. htaccess in project Root
folder):

RewriteEngine onRewriteBase /RewriteCond %{REQUEST_URI} !web/RewriteRule (.*) /web/$1 [L]我把apache的localhost指向了 localhost/phpixie/web,同时把上面的.htaccess塞在了phpixie路径下(根目录)。

At this time visit http://localhost can get Phpixie Welcome interface

3. Configuring 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'll 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'll 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

    Ask the great God to enlighten me where is the configuration wrong???

    Original address:http://www.phpixie.com/quickstart.html

    Reply content:

    1. Installation Framework

    php composer.phar create-project phpixie/project your_project_folder

    2. Setting the path

    Original: And here is rules for Apache2 (put to. htaccess in project Root
    folder):

    RewriteEngine onRewriteBase /RewriteCond %{REQUEST_URI} !web/RewriteRule (.*) /web/$1 [L]我把apache的localhost指向了 localhost/phpixie/web,同时把上面的.htaccess塞在了phpixie路径下(根目录)。

    At this time visit http://localhost can get Phpixie Welcome interface

    3. Configuring 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'll 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'll 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

    Ask the great God to enlighten me where is the configuration wrong???

    Original address:http://www.phpixie.com/quickstart.html

  • Related Article

    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.