From 4a567782a2ece1ceffebfc1efa580f654df8be1f Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 20 Nov 2017 09:58:03 +0200 Subject: [ci skip] More docs updates following #5330 --- user_guide_src/source/general/controllers.rst | 2 +- user_guide_src/source/general/core_classes.rst | 9 ++------- user_guide_src/source/general/creating_libraries.rst | 3 ++- user_guide_src/source/general/models.rst | 14 +------------- 4 files changed, 6 insertions(+), 22 deletions(-) (limited to 'user_guide_src/source/general') diff --git a/user_guide_src/source/general/controllers.rst b/user_guide_src/source/general/controllers.rst index 5a111d8dc..14e583636 100644 --- a/user_guide_src/source/general/controllers.rst +++ b/user_guide_src/source/general/controllers.rst @@ -337,4 +337,4 @@ list. That's it! ========== -That, in a nutshell, is all there is to know about controllers. \ No newline at end of file +That, in a nutshell, is all there is to know about controllers. diff --git a/user_guide_src/source/general/core_classes.rst b/user_guide_src/source/general/core_classes.rst index 79f73ef06..9ccded75c 100644 --- a/user_guide_src/source/general/core_classes.rst +++ b/user_guide_src/source/general/core_classes.rst @@ -83,6 +83,7 @@ application/core/MY_Input.php, and declare your class with:: public function __construct() { parent::__construct(); + // Your own constructor code } } @@ -98,12 +99,6 @@ your new class in your application controller's constructors. class Welcome extends MY_Controller { - public function __construct() - { - parent::__construct(); - // Your own constructor code - } - public function index() { $this->load->view('welcome_message'); @@ -119,4 +114,4 @@ To set your own sub-class prefix, open your $config['subclass_prefix'] = 'MY_'; Please note that all native CodeIgniter libraries are prefixed -with CI\_ so DO NOT use that as your prefix. \ No newline at end of file +with CI\_ so DO NOT use that as your prefix. diff --git a/user_guide_src/source/general/creating_libraries.rst b/user_guide_src/source/general/creating_libraries.rst index d6b0631af..83742b619 100644 --- a/user_guide_src/source/general/creating_libraries.rst +++ b/user_guide_src/source/general/creating_libraries.rst @@ -224,6 +224,7 @@ extend the parent constructor:: public function __construct($config = array()) { parent::__construct($config); + // Your own constructor code } } @@ -256,4 +257,4 @@ To set your own sub-class prefix, open your $config['subclass_prefix'] = 'MY_'; Please note that all native CodeIgniter libraries are prefixed with CI\_ -so DO NOT use that as your prefix. \ No newline at end of file +so DO NOT use that as your prefix. diff --git a/user_guide_src/source/general/models.rst b/user_guide_src/source/general/models.rst index eb842e927..0b20164e9 100644 --- a/user_guide_src/source/general/models.rst +++ b/user_guide_src/source/general/models.rst @@ -67,12 +67,6 @@ The basic prototype for a model class is this:: class Model_name extends CI_Model { - public function __construct() - { - parent::__construct(); - // Your own constructor code - } - } Where **Model_name** is the name of your class. Class names **must** have @@ -83,12 +77,6 @@ The file name must match the class name. For example, if this is your class:: class User_model extends CI_Model { - public function __construct() - { - parent::__construct(); - // Your own constructor code - } - } Your file will be this:: @@ -176,4 +164,4 @@ database. The following options for connecting are available to you: $config['pconnect'] = FALSE; $config['db_debug'] = TRUE; - $this->load->model('model_name', '', $config); \ No newline at end of file + $this->load->model('model_name', '', $config); -- cgit v1.2.3-24-g4f1b