额外的类路径(Additional Class Paths)

它是偶尔有用的应用程序之间能够共享MVC类在同一个系统上。如果你想要同样的控制器在两个应用程序,您可以使用CakePHP的引导。php将这些额外的类。
通过使用应用程序:App::build())。php可以定义额外的路径,CakePHP将寻找类:
App::build(array(
    'Model' => array(
        '/path/to/models',
        '/next/path/to/models'
    ),
    'Model/Behavior' => array(
        '/path/to/behaviors',
        '/next/path/to/behaviors'
    ),
    'Model/Datasource' => array(
        '/path/to/datasources',
        '/next/path/to/datasources'
    ),
    'Model/Datasource/Database' => array(
        '/path/to/databases',
        '/next/path/to/database'
    ),
    'Model/Datasource/Session' => array(
        '/path/to/sessions',
        '/next/path/to/sessions'
    ),
    'Controller' => array(
        '/path/to/controllers',
        '/next/path/to/controllers'
    ),
    'Controller/Component' => array(
        '/path/to/components',
        '/next/path/to/components'
    ),
    'Controller/Component/Auth' => array(
        '/path/to/auths',
        '/next/path/to/auths'
    ),
    'Controller/Component/Acl' => array(
        '/path/to/acls',
        '/next/path/to/acls'
    ),
    'View' => array(
        '/path/to/views',
        '/next/path/to/views'
    ),
    'View/Helper' => array(
        '/path/to/helpers',
        '/next/path/to/helpers'
    ),
    'Console' => array(
        '/path/to/consoles',
        '/next/path/to/consoles'
    ),
    'Console/Command' => array(
        '/path/to/commands',
        '/next/path/to/commands'
    ),
    'Console/Command/Task' => array(
        '/path/to/tasks',
        '/next/path/to/tasks'
    ),
    'Lib' => array(
        '/path/to/libs',
        '/next/path/to/libs'
    ),
    'Locale' => array(
        '/path/to/locales',
        '/next/path/to/locales'
    ),
    'Vendor' => array(
        '/path/to/vendors',
        '/next/path/to/vendors'
    ),
    'Plugin' => array(
        '/path/to/plugins',
        '/next/path/to/plugins'
    ),
));

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值