From e50d1a82e7c24f507049ddb77afd9e1cbb29d7e8 Mon Sep 17 00:00:00 2001
From: Derek Jones
Date: Thu, 8 May 2008 13:12:34 +0000
Subject: added code sample showing the necessity of referencing the extended
class in your application controllers instead of the core Controller class
when extending the Controller
---
user_guide/general/core_classes.html | 14 ++++++++++++++
1 file changed, 14 insertions(+)
(limited to 'user_guide/general/core_classes.html')
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 {
(this is known as "method overriding").
This allows you to substantially alter the CodeIgniter core.
+If you are extending the Controller core class, then be sure to extend your new class in your application controller's constructors.
+
+class Welcome extends MY_Controller {
+
+ function Welcome()
+ {
+ parent::MY_Controller();
+ }
+
+ function index()
+ {
+ $this->load->view('welcome_message');
+ }
+}
Setting Your Own Prefix
--
cgit v1.2.3-24-g4f1b