Skip to content

Commit

Permalink
Update modules
Browse files Browse the repository at this point in the history
  • Loading branch information
hungnguyenhp committed Sep 10, 2021
1 parent b499693 commit 585dcbc
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 0 deletions.
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,56 @@ Bổ sung thêm 1 số thư viện mở rộng, helpers liên quan

Support mô hình HMVC

## Hướng dẫn tích hợp mô hình HMVC vào dự án

1. Create folder: `modules` trong thư mục `application`. Tham khảo cấu trúc thư mục `modules` tại `sample/modules/` trong thư viện này

```shell
.
└── modules
└── startup
├── config
│   ├── index.html
│   └── routes.php
├── controllers
│   ├── Startup.php
│   └── index.html
├── index.html
├── models
│   ├── Startup_model.php
│   └── index.html
└── views
└── index.html

6 directories, 8 files
```

2. Create file `hmvc.php` với nội dung như sau

```php
<?php
defined('BASEPATH') or exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| HMVC settings
| -------------------------------------------------------------------------
| See: https://github.com/nguyenanhung/CodeIgniter-HMVC
|
*/
$config['modules_locations'] = array(
APPPATH . 'modules/' => '../modules/'
);

```

3. Nạp file `hmvc.php` vào file `config.php`

```php
require_once __DIR__ . '/hmvc.php';
```

4. Triển khai viết code trong thư mục modules mới

## Liên hệ

| Name | Email | Skype | Facebook |
Expand Down
11 changes: 11 additions & 0 deletions sample/modules/startup/config/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>

<p>Directory access is forbidden.</p>

</body>
</html>
11 changes: 11 additions & 0 deletions sample/modules/startup/config/routes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
/**
* Project my-portfolio
* Created by PhpStorm
* User: 713uk13m <[email protected]>
* Copyright: 713uk13m <[email protected]>
* Date: 09/10/2021
* Time: 13:37
*/
// $route['startup'] = "Startup/index";
1 change: 1 addition & 0 deletions sample/modules/startup/controllers/Startup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php
11 changes: 11 additions & 0 deletions sample/modules/startup/controllers/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>

<p>Directory access is forbidden.</p>

</body>
</html>
11 changes: 11 additions & 0 deletions sample/modules/startup/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>

<p>Directory access is forbidden.</p>

</body>
</html>
1 change: 1 addition & 0 deletions sample/modules/startup/models/Startup_model.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php
11 changes: 11 additions & 0 deletions sample/modules/startup/models/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>

<p>Directory access is forbidden.</p>

</body>
</html>
11 changes: 11 additions & 0 deletions sample/modules/startup/views/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>

<p>Directory access is forbidden.</p>

</body>
</html>

0 comments on commit 585dcbc

Please sign in to comment.