Skip to content

Commit 2c3bbb3

Browse files
committed
MY_Model needs some usage examples
This will allow anyone interested to see what it can achieve
1 parent 9ab463d commit 2c3bbb3

File tree

8 files changed

+180
-0
lines changed

8 files changed

+180
-0
lines changed

.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
config/doctypes.php
2+
cache
3+
config
4+
libraries
5+
hooks
6+
third_party
7+
logs
8+
language
9+
helpers
10+
views/errors
11+
.htaccess

controllers/Test.php

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
defined('BASEPATH') OR exit('No direct script access allowed');
3+
4+
class Test extends CI_Controller {
5+
6+
/**
7+
* Index Page for this controller.
8+
*
9+
* Maps to the following URL
10+
* http://example.com/index.php/welcome
11+
* - or -
12+
* http://example.com/index.php/welcome/index
13+
* - or -
14+
* Since this controller is set as the default controller in
15+
* config/routes.php, it's displayed at http://example.com/
16+
*
17+
* So any other public methods not prefixed with an underscore will
18+
* map to /index.php/welcome/<method_name>
19+
* @see http://codeigniter.com/user_guide/general/urls.html
20+
*/
21+
public function index()
22+
{
23+
$this->load->view('test_view');
24+
}
25+
}

controllers/index.html

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>403 Forbidden</title>
5+
</head>
6+
<body>
7+
8+
<p>Directory access is forbidden.</p>
9+
10+
</body>
11+
</html>

core/index.html

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>403 Forbidden</title>
5+
</head>
6+
<body>
7+
8+
<p>Directory access is forbidden.</p>
9+
10+
</body>
11+
</html>

index.html

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>403 Forbidden</title>
5+
</head>
6+
<body>
7+
8+
<p>Directory access is forbidden.</p>
9+
10+
</body>
11+
</html>

models/index.html

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>403 Forbidden</title>
5+
</head>
6+
<body>
7+
8+
<p>Directory access is forbidden.</p>
9+
10+
</body>
11+
</html>

views/index.html

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>403 Forbidden</title>
5+
</head>
6+
<body>
7+
8+
<p>Directory access is forbidden.</p>
9+
10+
</body>
11+
</html>

views/test_view.php

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?php
2+
defined('BASEPATH') OR exit('No direct script access allowed');
3+
?><!DOCTYPE html>
4+
<html lang="en">
5+
<head>
6+
<meta charset="utf-8">
7+
<title>Welcome to CodeIgniter</title>
8+
9+
<style type="text/css">
10+
11+
::selection { background-color: #E13300; color: white; }
12+
::-moz-selection { background-color: #E13300; color: white; }
13+
14+
body {
15+
background-color: #fff;
16+
margin: 40px;
17+
font: 13px/20px normal Helvetica, Arial, sans-serif;
18+
color: #4F5155;
19+
}
20+
21+
a {
22+
color: #003399;
23+
background-color: transparent;
24+
font-weight: normal;
25+
}
26+
27+
h1 {
28+
color: #444;
29+
background-color: transparent;
30+
border-bottom: 1px solid #D0D0D0;
31+
font-size: 19px;
32+
font-weight: normal;
33+
margin: 0 0 14px 0;
34+
padding: 14px 15px 10px 15px;
35+
}
36+
37+
code {
38+
font-family: Consolas, Monaco, Courier New, Courier, monospace;
39+
font-size: 12px;
40+
background-color: #f9f9f9;
41+
border: 1px solid #D0D0D0;
42+
color: #002166;
43+
display: block;
44+
margin: 14px 0 14px 0;
45+
padding: 12px 10px 12px 10px;
46+
}
47+
48+
#body {
49+
margin: 0 15px 0 15px;
50+
}
51+
52+
p.footer {
53+
text-align: right;
54+
font-size: 11px;
55+
border-top: 1px solid #D0D0D0;
56+
line-height: 32px;
57+
padding: 0 10px 0 10px;
58+
margin: 20px 0 0 0;
59+
}
60+
61+
#container {
62+
margin: 10px;
63+
border: 1px solid #D0D0D0;
64+
box-shadow: 0 0 8px #D0D0D0;
65+
}
66+
</style>
67+
</head>
68+
<body>
69+
70+
<div id="container">
71+
<h1>Welcome to CodeIgniter!</h1>
72+
73+
<div id="body">
74+
<p>The page you are looking at is being generated dynamically by CodeIgniter.</p>
75+
76+
<p>If you would like to edit this page you'll find it located at:</p>
77+
<code>application/views/welcome_message.php</code>
78+
79+
<p>The corresponding controller for this page is found at:</p>
80+
<code>application/controllers/Welcome.php</code>
81+
82+
<p>If you are exploring CodeIgniter for the very first time, you should start by reading the <a href="user_guide/">User Guide</a>.</p>
83+
</div>
84+
85+
<p class="footer">Page rendered in <strong>{elapsed_time}</strong> seconds. <?php echo (ENVIRONMENT === 'development') ? 'CodeIgniter Version <strong>' . CI_VERSION . '</strong>' : '' ?></p>
86+
</div>
87+
88+
</body>
89+
</html>

0 commit comments

Comments
 (0)