From e79d41a0de8a21db83fdb6b3e25ae65c9923c46d Mon Sep 17 00:00:00 2001
From: Pascal Kriete
function __construct()
{
- parent::CI_Controller();
+ parent::__construct();
// Your own constructor code
}
}
diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html
index ac965aee3..35043d9ca 100644
--- a/user_guide/general/core_classes.html
+++ b/user_guide/general/core_classes.html
@@ -131,9 +131,9 @@ class MY_Input extends CI_Input {
class MY_Input extends CI_Input {
@@ -145,9 +145,9 @@ This allows you to substantially alter the CodeIgniter core.
- function MY_Input()
+ function __construct()
{
- parent::CI_Input();
+ parent::__construct();
}
}
class Welcome extends MY_Controller {
- function Welcome()
+ function __construct()
{
- parent::MY_Controller();
+ parent::__construct();
}
function index()
diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html
index 3f0e32cb0..00d0f4aa4 100644
--- a/user_guide/general/creating_libraries.html
+++ b/user_guide/general/creating_libraries.html
@@ -141,7 +141,7 @@ $this->load->library('Someclass', $params);
class MY_Email extends CI_Email {
- function My_Email()
+ function __construct()
{
- parent::CI_Email();
+ parent::__construct();
}
}
diff --git a/user_guide/general/models.html b/user_guide/general/models.html
index 35ab08d20..466996648 100644
--- a/user_guide/general/models.html
+++ b/user_guide/general/models.html
@@ -83,10 +83,10 @@ class Blogmodel extends CI_Model {
class Model_name extends CI_Model {
- function Model_name()
+ function __construct()
{
- parent::CI_Model();
+ parent::__construct();
}
}
@@ -142,9 +142,9 @@ Make sure your class extends the base Model class.
class User_model extends CI_Model {
- function User_model()
+ function __construct()
{
- parent::CI_Model();
+ parent::__construct();
}
}
diff --git a/user_guide/general/styleguide.html b/user_guide/general/styleguide.html
index 7b7d837d9..f30f45529 100644
--- a/user_guide/general/styleguide.html
+++ b/user_guide/general/styleguide.html
@@ -161,7 +161,7 @@ echo "Here's my code!";
Class names should always have their first letter uppercase, and the constructor method should match identically. Multiple words should be separated with an underscore, and not CamelCased. All other class methods should be entirely lowercased and named to clearly indicate their function, preferably including a verb. Try to avoid overly long and verbose names.
+Class names should always start with an uppercase letter. Multiple words should be separated with an underscore, and not CamelCased. All other class methods should be entirely lowercased and named to clearly indicate their function, preferably including a verb. Try to avoid overly long and verbose names.
INCORRECT:
class superclass
@@ -170,11 +170,10 @@ class SuperClass
CORRECT:
class Super_class
- Notice that the Class and constructor methods are identically named and cased:
class Super_class {
- function Super_class()
+ function __construct()
{
}
--
cgit v1.2.3-24-g4f1b