summaryrefslogtreecommitdiffstats
path: root/user_guide/general
diff options
context:
space:
mode:
authorPascal Kriete <pascal.kriete@ellislab.com>2010-11-10 22:41:23 +0100
committerPascal Kriete <pascal.kriete@ellislab.com>2010-11-10 22:41:23 +0100
commite79d41a0de8a21db83fdb6b3e25ae65c9923c46d (patch)
tree6eddba47a27b9ee5d7a53315aaaaa7bf86df856c /user_guide/general
parent00921a54feb7fde4444401ab93d77780c6c3bb96 (diff)
Userguide tweaks to show proper PHP 5 examples and removing the compat helper from the menu.
Diffstat (limited to 'user_guide/general')
-rw-r--r--user_guide/general/controllers.html2
-rw-r--r--user_guide/general/core_classes.html8
-rw-r--r--user_guide/general/creating_libraries.html6
-rw-r--r--user_guide/general/models.html12
-rw-r--r--user_guide/general/styleguide.html5
5 files changed, 16 insertions, 17 deletions
diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html
index bcd0e4bce..1d9cd0328 100644
--- a/user_guide/general/controllers.html
+++ b/user_guide/general/controllers.html
@@ -340,7 +340,7 @@ class <kbd>Blog</kbd> extends CI_Controller {<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function <kbd>__construct()</kbd><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<var>parent::CI_Controller();</var><br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<var>parent::__construct();</var><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Your own constructor code<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}<br />
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 {<br /><br />
<code>
class MY_Input extends CI_Input {<br />
<br />
-&nbsp;&nbsp;&nbsp;&nbsp;function MY_Input()<br />
+&nbsp;&nbsp;&nbsp;&nbsp;function __construct()<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent::CI_Input();<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent::__construct();<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}</code>
@@ -145,9 +145,9 @@ This allows you to substantially alter the CodeIgniter core.</p>
<code>class Welcome extends MY_Controller {<br />
<br />
-&nbsp;&nbsp;&nbsp;&nbsp;function Welcome()<br />
+&nbsp;&nbsp;&nbsp;&nbsp;function __construct()<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent::MY_Controller();<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent::__construct();<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;function index()<br />
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', <kbd>$params</kbd>);</code>
<br />
class Someclass {<br />
<br />
-&nbsp;&nbsp;&nbsp;&nbsp;function Someclass($params)<br />
+&nbsp;&nbsp;&nbsp;&nbsp;function __construct($params)<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Do something with $params<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
@@ -248,9 +248,9 @@ class MY_Email extends CI_Email {<br /><br />
<code>
class MY_Email extends CI_Email {<br />
<br />
-&nbsp;&nbsp;&nbsp;&nbsp;function My_Email()<br />
+&nbsp;&nbsp;&nbsp;&nbsp;function __construct()<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent::CI_Email();<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent::__construct();<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}</code>
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&nbsp;Blogmodel&nbsp;extends&nbsp;CI_Model&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;var $content = '';<br />
&nbsp;&nbsp;&nbsp;&nbsp;var $date&nbsp;&nbsp;&nbsp; = '';<br />
<br />
-&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;Blogmodel()<br />
+&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;__construct()<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Call the Model constructor<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent::CI_Model();<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent::__construct();<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;get_last_ten_entries()<br />
@@ -128,9 +128,9 @@ want this type of organization.</p>
<code>
class&nbsp;<var>Model_name</var>&nbsp;extends&nbsp;CI_Model&nbsp;{<br />
<br />
-&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;<var>Model_name</var>()<br />
+&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;<var>__construct</var>()<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent::CI_Model();<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent::__construct();<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}</code>
@@ -142,9 +142,9 @@ Make sure your class extends the base Model class.</p>
<code>
class&nbsp;<var>User_model</var>&nbsp;extends&nbsp;CI_Model&nbsp;{<br />
<br />
-&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;<var>User_model</var>()<br />
+&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;<var>__construct</var>()<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent::CI_Model();<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent::__construct();<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}</code>
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!";
<h2><a name="class_and_method_naming"></a>Class and Method Naming</h2>
<div class="guidelineDetails">
- <p>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.</p>
+ <p>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.</p>
<code><strong>INCORRECT</strong>:
class superclass
@@ -170,11 +170,10 @@ class SuperClass
<strong>CORRECT</strong>:
class Super_class</code>
- <p>Notice that the Class and constructor methods are identically named and cased:</p>
<code>class Super_class {
- function Super_class()
+ function __construct()
{
}