diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-29 10:36:14 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-29 10:36:14 +0200 |
commit | 5b46f42d654e7474a47ecfd9f7dafece98ee668e (patch) | |
tree | ba1641fa43469ea3b58c2b1904de9b68c750d26a /user_guide_src/source/general/views.rst | |
parent | 8aea4f49c81199661d3f6e49ff6142b886ea7226 (diff) | |
parent | 38b2a256758ee8184d354cbdb0eac467118af36b (diff) |
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into develop-db-postgre
Diffstat (limited to 'user_guide_src/source/general/views.rst')
-rw-r--r-- | user_guide_src/source/general/views.rst | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/user_guide_src/source/general/views.rst b/user_guide_src/source/general/views.rst index dc65f6c4f..9b7c9daaa 100644 --- a/user_guide_src/source/general/views.rst +++ b/user_guide_src/source/general/views.rst @@ -49,7 +49,7 @@ replace the echo statement with the view loading function:: <?php class Blog extends CI_Controller { - function index() + public function index() { $this->load->view('blogview'); } @@ -74,14 +74,14 @@ might look something like this:: class Page extends CI_Controller { - function index() - { - $data['page_title'] = 'Your title'; - $this->load->view('header'); - $this->load->view('menu'); - $this->load->view('content', $data); - $this->load->view('footer'); - } + public function index() + { + $data['page_title'] = 'Your title'; + $this->load->view('header'); + $this->load->view('menu'); + $this->load->view('content', $data); + $this->load->view('footer'); + } } ?> @@ -126,7 +126,7 @@ Let's try it with your controller file. Open it add this code:: <?php class Blog extends CI_Controller { - function index() + public function index() { $data['title'] = "My Real Title"; $data['heading'] = "My Real Heading"; @@ -164,7 +164,7 @@ Here's a simple example. Add this to your controller:: <?php class Blog extends CI_Controller { - function index() + public function index() { $data['todo_list'] = array('Clean House', 'Call Mom', 'Run Errands'); |