English 中文(简体)
• 如何使用Kohaana 套管系统实施HMVC
原标题:How to implement HMVC using Kohana s cascading file system

Kohana 3.2 旨在支持HMVC的设计模式。 HMVC型号由骑自行车组成。 然而,就我所知,Kohaana的碎块档案系统要求所有模型和主计长都放在最高级的级别名录内,并且把意见输入一个最高的观点目录。 如果模型/变体因此与档案系统的顶级意见分离,那么我们应如何实施封套的MVC-triads?

“entergraph

问题回答

您不敢 ha弄处理意见的方式,但可以扩大<代码>。 Kohana_View_filename()功能的班级将接受你想要的任何名录。

如果你想要一个类似于控制器/模型的自动载荷特征,你可以执行。

例如(未测试):

public function set_filename($view)
{        
    // Transform the class name into a path
    $file = str_replace( _ ,  / , strtolower($view));

    if ($path = Kohana::find_file( classes , $file))
    {
        // Store the file path locally
        $this->_file = $path;

        return $this;
    }  

    throw new View_Exception( The requested view :view could not be found , array(
         :view  => $view,
    ));
}

然而,就我所知,Kohaana的碎块档案系统要求所有模型和主计长都放在最高级的级别名录内,并且把意见输入一个最高的观点目录。

你们似乎想要的是像Kohana 2、密码编辑和其他最可能的框架这样的双重结构,这些框架为控制者、模式和看法专门配备了多个手。 Kohana 3 专设课堂。 Kohana 3的建立方式使控制者应有一名主计长——预先确定。 Kohana 3个自动载荷将寻找由主计长负责的班级/控制器夹。

然后,Kohana 3也进入非常基本的模型和观点类别。 据我所知,Kohaana 3核心没有使用《示范公约》的类别,它只在几个场合使用《观点》。 但是,在《示范法》中可以找到为模式提供模式的《示范公约》:但《示范法》没有执行。 你们不必使用。

观点组研究意见夹中的模板。 Zombor(不是Zombor建议的),由Zombor(一个发展中国家)进行观察。 The (redom amended by Zombor) KOstache model, redom amended by Zombor, see for its models rafter. 两个单元都允许你设立《公约》要先见的“观点”课程,以结束课程/观点。 但是,没有任何东西阻止你产生一种观点——这种观点延伸到哪一类。 各位对每个模板的看法,都把这一观点-模式放在了脚步上。

请尊重班轮只为班级。





相关问题
Kohana - subfolders within views folder

I m working on the admin section of a site using Kohana. I ve created a "admin" subfolder within the views folder to store admin views. I m also using a modified instance of the Template Controller ...

approach for "site down for maintenance"

I have been using Joomla and I love its administrative facility to put the site down for maintenance. As I have seen, all requests to the site if it is in maintenance mode is routed to a single page. ...

Kohana 3: using maintainable routes

I m using Kohana v3 for a web project, and today I found myself writing this: echo Html::anchor( user/view/ .$user->id, "See user s profile"); If I rename the action_view method in the User ...

Is using a Mail Model in MVC incorrect?

I have built a model in some of my MVC websites to assist with sending emails, generally I do something like this $mail = new Mail_Model; $mail->to( me@somewhere.com ); $mail->from( you@...

help on building a basic php search engine

i looked for tutorials everywhere but just can t seem to get a good one... a search page with pagination, column header sorting, and multiple filtering(filters are in checkboxes) the problem: had ...

What s the proper MVC way to do this....?

Quick question about general MVC design principle in PHP, using CodeIgniter or Kohana (I m actually using Kohana). I m new to MVC and don t want to get this wrong... so I m wondering if i have ...

Kohana Error... Attempt to assign property of non-object

So I m trying to go through the Version 3 Guide of Kohana and keep getting an error on the hello world create view part. ErrorException [ Warning ]: Attempt to assign property of non-object Line 8: $...

热门标签