From d13803813b355fccb17dd4f148f43b7a20977781 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Mon, 25 Jun 2012 23:54:18 -0700 Subject: First pass at ToC remediation --- user_guide_src/source/general/welcome.rst | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 user_guide_src/source/general/welcome.rst (limited to 'user_guide_src/source/general') diff --git a/user_guide_src/source/general/welcome.rst b/user_guide_src/source/general/welcome.rst new file mode 100644 index 000000000..b28c3bcc2 --- /dev/null +++ b/user_guide_src/source/general/welcome.rst @@ -0,0 +1,32 @@ +###################### +Welcome to CodeIgniter +###################### + +CodeIgniter is an Application Development Framework - a toolkit - for +people who build web sites using PHP. Its goal is to enable you to +develop projects much faster than you could if you were writing code +from scratch, by providing a rich set of libraries for commonly needed +tasks, as well as a simple interface and logical structure to access +these libraries. CodeIgniter lets you creatively focus on your project +by minimizing the amount of code needed for a given task. + +*********************** +Who is CodeIgniter For? +*********************** + +CodeIgniter is right for you if: + +- You want a framework with a small footprint. +- You need exceptional performance. +- You need broad compatibility with standard hosting accounts that run + a variety of PHP versions and configurations. +- You want a framework that requires nearly zero configuration. +- You want a framework that does not require you to use the command + line. +- You want a framework that does not require you to adhere to + restrictive coding rules. +- You are not interested in large-scale monolithic libraries like PEAR. +- You do not want to be forced to learn a templating language (although + a template parser is optionally available if you desire one). +- You eschew complexity, favoring simple solutions. +- You need clear, thorough documentation. -- cgit v1.2.3-24-g4f1b From b94b91afc77bcc133ff282559015933602bb2d3f Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 4 Jul 2012 12:32:14 +0300 Subject: Some user guide updates --- user_guide_src/source/general/models.rst | 61 ++++++++++++++++---------------- 1 file changed, 31 insertions(+), 30 deletions(-) (limited to 'user_guide_src/source/general') diff --git a/user_guide_src/source/general/models.rst b/user_guide_src/source/general/models.rst index 2e1e025ee..4e52a9648 100644 --- a/user_guide_src/source/general/models.rst +++ b/user_guide_src/source/general/models.rst @@ -72,10 +72,11 @@ The basic prototype for a model class is this:: class Model_name extends CI_Model { - function __construct() - { - parent::__construct(); - } + public function __construct() + { + parent::__construct(); + } + } Where **Model_name** is the name of your class. Class names **must** have @@ -87,10 +88,11 @@ example, if your class is this:: class User_model extends CI_Model { - function __construct() - { - parent::__construct(); - } + public function __construct() + { + parent::__construct(); + } + } Your file will be this:: @@ -102,7 +104,7 @@ Loading a Model Your models will typically be loaded and called from within your :doc:`controller ` functions. To load a model you will use -the following function:: +the following method:: $this->load->model('model_name'); @@ -112,33 +114,34 @@ application/models/blog/queries.php you'll load it using:: $this->load->model('blog/queries'); -Once loaded, you will access your model functions using an object with -the same name as your class:: +Once loaded, you will access your model methods using an object with the +same name as your class:: $this->load->model('model_name'); - $this->model_name->function(); + $this->model_name->method(); If you would like your model assigned to a different object name you can -specify it via the second parameter of the loading function:: +specify it via the second parameter of the loading method:: - $this->load->model('model_name', 'fubar'); + $this->load->model('model_name', 'foobar'); - $this->fubar->function(); + $this->foobar->method(); Here is an example of a controller, that loads a model, then serves a view:: class Blog_controller extends CI_Controller { - function blog() - { - $this->load->model('blog'); + public function blog() + { + $this->load->model('blog'); - $data['query'] = $this->Blog->get_last_ten_entries(); + $data['query'] = $this->Blog->get_last_ten_entries(); + + $this->load->view('blog', $data); + } - $this->load->view('blog', $data); - } } @@ -170,15 +173,13 @@ database. The following options for connecting are available to you: - You can manually pass database connectivity settings via the third parameter:: - $config['hostname'] = "localhost"; - $config['username'] = "myusername"; - $config['password'] = "mypassword"; - $config['database'] = "mydatabase"; - $config['dbdriver'] = "mysql"; - $config['dbprefix'] = ""; + $config['hostname'] = 'localhost'; + $config['username'] = 'myusername'; + $config['password'] = 'mypassword'; + $config['database'] = 'mydatabase'; + $config['dbdriver'] = 'mysqli'; + $config['dbprefix'] = ''; $config['pconnect'] = FALSE; $config['db_debug'] = TRUE; - $this->load->model('Model_name', '', $config); - - + $this->load->model('Model_name', '', $config); \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 5f733c4fd1369a185804cd7b6d27debc50ab1826 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Sat, 15 Sep 2012 10:48:17 +0200 Subject: Update reserved names documentation - EXT removed in 079fbfcde095230f304e889217f897031a948f61 - VIEWPATH added in 8eef9c77512d4fad5357d3cbda83b89f844d7d16 --- user_guide_src/source/general/reserved_names.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src/source/general') diff --git a/user_guide_src/source/general/reserved_names.rst b/user_guide_src/source/general/reserved_names.rst index 5ce7fc2ff..3354375c5 100644 --- a/user_guide_src/source/general/reserved_names.rst +++ b/user_guide_src/source/general/reserved_names.rst @@ -45,11 +45,11 @@ Constants --------- - ENVIRONMENT -- EXT - FCPATH - SELF - BASEPATH - APPPATH +- VIEWPATH - CI_VERSION - FILE_READ_MODE - FILE_WRITE_MODE -- cgit v1.2.3-24-g4f1b