diff options
-rw-r--r-- | user_guide/general/core_classes.html | 14 |
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 />
+ function Welcome()<br />
+ {<br />
+ parent::MY_Controller();<br />
+ }<br />
+<br />
+ function index()<br />
+ {<br />
+ $this->load->view('welcome_message');<br />
+ }<br />
+}</code>
<h3>Setting Your Own Prefix</h3>
|