summaryrefslogtreecommitdiffstats
path: root/user_guide/general
diff options
context:
space:
mode:
Diffstat (limited to 'user_guide/general')
-rw-r--r--user_guide/general/core_classes.html14
1 files changed, 14 insertions, 0 deletions
diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html
index 65e9a2b2b..ff9896c3e 100644
--- a/user_guide/general/core_classes.html
+++ b/user_guide/general/core_classes.html
@@ -140,6 +140,20 @@ class MY_Input extends CI_Input {<br />
(this is known as "method overriding").
This allows you to substantially alter the CodeIgniter core.</p>
+<p>If you are extending the Controller core class, then be sure to extend your new class in your application controller's constructors.</p>
+
+<code>class Welcome extends MY_Controller {<br />
+<br />
+&nbsp;&nbsp;&nbsp;&nbsp;function Welcome()<br />
+&nbsp;&nbsp;&nbsp;&nbsp;{<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent::MY_Controller();<br />
+&nbsp;&nbsp;&nbsp;&nbsp;}<br />
+<br />
+&nbsp;&nbsp;&nbsp;&nbsp;function index()<br />
+&nbsp;&nbsp;&nbsp;&nbsp;{<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this->load->view('welcome_message');<br />
+&nbsp;&nbsp;&nbsp;&nbsp;}<br />
+}</code>
<h3>Setting Your Own Prefix</h3>