diff options
author | Anton Lindqvist <anton@qvister.se> | 2012-04-25 12:08:37 +0200 |
---|---|---|
committer | Anton Lindqvist <anton@qvister.se> | 2012-04-25 12:08:37 +0200 |
commit | 92f10e837d132f9866626d3f2e0a633b22329ebb (patch) | |
tree | e3ade8c7dd46f90690455fb2dcc112d6d015c980 /user_guide_src/source/general | |
parent | 210e664abe857ddd267a7ba8713e2318d3e59a9c (diff) | |
parent | f8ae11598ba058ee02cc4f8c82dbab3420756aae (diff) |
Merge branch 'develop' of https://github.com/EllisLab/CodeIgniter into develop
Conflicts:
system/libraries/Cache/Cache.php
Diffstat (limited to 'user_guide_src/source/general')
-rw-r--r-- | user_guide_src/source/general/creating_libraries.rst | 16 | ||||
-rw-r--r-- | user_guide_src/source/general/requirements.rst | 6 | ||||
-rw-r--r-- | user_guide_src/source/general/styleguide.rst | 19 | ||||
-rw-r--r-- | user_guide_src/source/general/urls.rst | 9 | ||||
-rw-r--r-- | user_guide_src/source/general/views.rst | 22 |
5 files changed, 48 insertions, 24 deletions
diff --git a/user_guide_src/source/general/creating_libraries.rst b/user_guide_src/source/general/creating_libraries.rst index bc545b483..673fbd4bb 100644 --- a/user_guide_src/source/general/creating_libraries.rst +++ b/user_guide_src/source/general/creating_libraries.rst @@ -188,17 +188,23 @@ application/libraries/MY_Email.php, and declare your class with:: } -Note: If you need to use a constructor in your class make sure you +If you need to use a constructor in your class make sure you extend the parent constructor:: class MY_Email extends CI_Email { - public function __construct() - { - parent::__construct(); - } + public function __construct($config = array()) + { + parent::__construct($config); + } + } +.. note:: + Not all of the libraries have the same (or any) parameters + in their constructor. Take a look at the library that you're + extending first to see how it should be implemented. + Loading Your Sub-class ---------------------- diff --git a/user_guide_src/source/general/requirements.rst b/user_guide_src/source/general/requirements.rst index 38623557d..d97b7b4b2 100644 --- a/user_guide_src/source/general/requirements.rst +++ b/user_guide_src/source/general/requirements.rst @@ -2,7 +2,7 @@ Server Requirements ################### -- `PHP <http://www.php.net/>`_ version 5.1.6 or newer. +- `PHP <http://www.php.net/>`_ version 5.2.4 or newer. - A Database is required for most web application programming. Current - supported databases are MySQL (4.1+), MySQLi, MS SQL, Postgres, Oracle, - SQLite, ODBC and CUBRID.
\ No newline at end of file + supported databases are MySQL (5.1+), MySQLi, MS SQL, SQLSRV, Oracle, + PostgreSQL, SQLite, SQLite3, CUBRID, Interbase, ODBC and PDO. diff --git a/user_guide_src/source/general/styleguide.rst b/user_guide_src/source/general/styleguide.rst index b3dc08871..2b91d1cc0 100644 --- a/user_guide_src/source/general/styleguide.rst +++ b/user_guide_src/source/general/styleguide.rst @@ -94,7 +94,7 @@ overly long and verbose names. class Super_class { - function __construct() + public function __construct() { } @@ -168,7 +168,6 @@ picked up by IDEs:: /** * Encodes string for use in XML * - * @access public * @param string * @return string */ @@ -441,6 +440,13 @@ same level as the control statement that "owns" them. // ... } } + + try { + // ... + } + catch() { + // ... + } **CORRECT**:: @@ -470,6 +476,15 @@ same level as the control statement that "owns" them. // ... } } + + try + { + // ... + } + catch() + { + // ... + } Bracket and Parenthetic Spacing =============================== diff --git a/user_guide_src/source/general/urls.rst b/user_guide_src/source/general/urls.rst index 857078b1c..6b390b559 100644 --- a/user_guide_src/source/general/urls.rst +++ b/user_guide_src/source/general/urls.rst @@ -39,9 +39,10 @@ By default, the **index.php** file will be included in your URLs:: example.com/index.php/news/article/my_article -You can easily remove this file by using a .htaccess file with some -simple rules. Here is an example of such a file, using the "negative" -method in which everything is redirected except the specified items: +If your Apache server has mod_rewrite enabled, you can easily remove this +file by using a .htaccess file with some simple rules. Here is an example +of such a file, using the "negative" method in which everything is redirected +except the specified items: :: @@ -53,6 +54,8 @@ method in which everything is redirected except the specified items: In the above example, any HTTP request other than those for existing directories and existing files is treated as a request for your index.php file. +.. note:: Note: These specific rules might not work for all server configurations. + Adding a URL Suffix =================== diff --git a/user_guide_src/source/general/views.rst b/user_guide_src/source/general/views.rst index dc65f6c4f..9b7c9daaa 100644 --- a/user_guide_src/source/general/views.rst +++ b/user_guide_src/source/general/views.rst @@ -49,7 +49,7 @@ replace the echo statement with the view loading function:: <?php class Blog extends CI_Controller { - function index() + public function index() { $this->load->view('blogview'); } @@ -74,14 +74,14 @@ might look something like this:: class Page extends CI_Controller { - function index() - { - $data['page_title'] = 'Your title'; - $this->load->view('header'); - $this->load->view('menu'); - $this->load->view('content', $data); - $this->load->view('footer'); - } + public function index() + { + $data['page_title'] = 'Your title'; + $this->load->view('header'); + $this->load->view('menu'); + $this->load->view('content', $data); + $this->load->view('footer'); + } } ?> @@ -126,7 +126,7 @@ Let's try it with your controller file. Open it add this code:: <?php class Blog extends CI_Controller { - function index() + public function index() { $data['title'] = "My Real Title"; $data['heading'] = "My Real Heading"; @@ -164,7 +164,7 @@ Here's a simple example. Add this to your controller:: <?php class Blog extends CI_Controller { - function index() + public function index() { $data['todo_list'] = array('Clean House', 'Call Mom', 'Run Errands'); |