php框架 - 一个PHPixie框架的问题

WBOY
發布: 2016-06-06 20:26:47
原創
1862 人瀏覽過

1. 安装框架

<code>php composer.phar create-project phpixie/project your_project_folder</code>
登入後複製
登入後複製

2.设置路径

原文:And here are rules for Apache2 (put into .htaccess in project root
folder):

<code>RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !web/
RewriteRule (.*) /web/$1 [L]

我把apache的localhost指向了 localhost/phpixie/web,同时把上面的.htaccess塞在了phpixie路径下(根目录)。
</code>
登入後複製
登入後複製

这时候访问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
{

<code>/**</code>
登入後複製
登入後複製
    • 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)
      {

      <code>   $this->builder = $builder;</code>
      登入後複製
      登入後複製

      }

      // This is the default action

    3. function defaultAction(Request $request)
      {

      <code>   return "Quickstart tutorial";</code>
      登入後複製
      登入後複製

      }

      //We will be adding methods here in a moment
      }

    <code>// bundles/app/src/Project/App/HTTPProcessor.php
    
    //...
        protected function buildQuickstartProcessor()
        {
            return new HTTPProcessors\Quickstart(
                $this->builder
            );
        }
    //...
    
    然后访问 **http://localhost/quickstart/** 却发现是404
    </code>
    登入後複製
    登入後複製

    求大神赐教我是哪里配置错了???

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

    回复内容:

    1. 安装框架

    <code>php composer.phar create-project phpixie/project your_project_folder</code>
    登入後複製
    登入後複製

    2.设置路径

    原文:And here are rules for Apache2 (put into .htaccess in project root
    folder):

    <code>RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_URI} !web/
    RewriteRule (.*) /web/$1 [L]
    
    我把apache的localhost指向了 localhost/phpixie/web,同时把上面的.htaccess塞在了phpixie路径下(根目录)。
    </code>
    登入後複製
    登入後複製

    这时候访问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
    {

    <code>/**</code>
    登入後複製
    登入後複製
    • 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)
      {

      <code>   $this->builder = $builder;</code>
      登入後複製
      登入後複製

      }

      // This is the default action

    3. function defaultAction(Request $request)
      {

      <code>   return "Quickstart tutorial";</code>
      登入後複製
      登入後複製

      }

      //We will be adding methods here in a moment
      }

    <code>// bundles/app/src/Project/App/HTTPProcessor.php
    
    //...
        protected function buildQuickstartProcessor()
        {
            return new HTTPProcessors\Quickstart(
                $this->builder
            );
        }
    //...
    
    然后访问 **http://localhost/quickstart/** 却发现是404
    </code>
    登入後複製
    登入後複製

    求大神赐教我是哪里配置错了???

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

    相關標籤:
    來源:php.cn
    本網站聲明
    本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
    熱門教學
    更多>
    最新下載
    更多>
    網站特效
    網站源碼
    網站素材
    前端模板