2012-02-07 40 views
1

我想为管理员制作不同的面板。我创建了一个文件夹'Admin',并且在那里放入了index.php文件和'lib'文件夹以及Frontend.php和Auth.php。在管理面板的页面中,我想从我的主文件夹中使用模型,模板等。我如何将此添加到路径查找器?文件夹结构如何将路径添加到探路者?

  1. MainSite
    1. 联系
      1. LIB
        1. Frontend.php
        2. Auth.php
      2. 的index.php
      3. 的config.php
    2. atk4
    3. atk4-插件
    4. LIB(型号我想使用,窗体ECT,Frontend.php,Auth.php)
    5. 模板
    6. 的config.php
    7. 的index.php

回答

1

本添加到您的应用程序的init()

$this->addLocation('..',array(
    'php'=>array(
     'lib', 
     'atk4-addons/mvc', 
     'atk4-addons/misc/lib', 
    ), 
    'template'=>'templates', 
    'mail'=>'templates/mail', // if you want to share mail templates 
))->setParent($this->pathfinder->base_location); 

此外,一定要使用

$config['atk']['base_path']='/atk4/'; 

和你的index.php需要包括 '../atk4/loader.php';