如何在Codeigniter 3.0中实现HMVC? [英] How to implement HMVC in codeigniter 3.0?

查看:86
本文介绍了如何在Codeigniter 3.0中实现HMVC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我正在使用 codeigniter 3.0版。我想知道如何在其中实现HMVC结构,有人可以帮忙吗?

Currently I'm using codeigniter version 3.0. I want to know how to implement HMVC structure in it, can anyone help?

推荐答案

codeigniter 3 hmvc modules文件夹用于:

codeigniter 3 hmvc modules folder for:

https:// bitbucket。 org / wiredesignz / codeigniter-modular-extensions-hmvc / downloads

1-下载文件并在应用程序中复制Ci3.0 forder

1- Download files and copy C.i.3.0 forder in application

2- .htaccess

2- .htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

3-创建/应用程序/模块

3- create /application/modules

4- / application / modules /欢迎在控制器,模型,视图中创建

4- /application/modules/welcome create in controllers, models, views

5-创建/application/modules/welcome/controllers/Welcome.php

5- Create /application/modules/welcome/controllers/Welcome.php

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Welcome extends CI_Controller {

    public function index()
    {
        $this->load->view('welcome_message');
    }
}

享受:)


重要提示:文件夹中的 controllers和 models首字母文件应该很大。字母中每个文件夹的文件视图应该很小

IMPORTANT : 'controllers' and 'models' initials files in the folder should be large. 'views' of files per folder in the letter should be small

这篇关于如何在Codeigniter 3.0中实现HMVC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆