php架構 - 一個PHPixie架構的問題

來源:互聯網
上載者:User
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
      */

    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        );    }//...然後訪問 **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
      */

    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        );    }//...然後訪問 **http://localhost/quickstart/** 卻發現是404

    求大神賜教我是哪裡配置錯了???

    原文地址:http://www.phpixie.com/quickstart.html

  • 相關文章

    聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    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.