From 58dfc089bf5b0ca35c2ff244e5bfdff726f9adcd Mon Sep 17 00:00:00 2001 From: Melounek Date: Fri, 29 Jun 2012 08:43:47 +0200 Subject: added parameter for returned-path in Email::from() --- user_guide_src/source/libraries/email.rst | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/email.rst b/user_guide_src/source/libraries/email.rst index f99eb91df..8d2549d11 100644 --- a/user_guide_src/source/libraries/email.rst +++ b/user_guide_src/source/libraries/email.rst @@ -117,6 +117,13 @@ Sets the email address and name of the person sending the email:: $this->email->from('you@example.com', 'Your Name'); +:: + + $this->email->from('you@example.com', 'Your Name', 'returned_emails@example.com'); + +Third parameter is redirect for undelivered emails (may not be configured with +protocol 'smtp'). + $this->email->reply_to() ------------------------- -- cgit v1.2.3-24-g4f1b From 19ac8bc3fc55460660cca618b6cce0ef212e7bdc Mon Sep 17 00:00:00 2001 From: RecoilUK Date: Thu, 23 Aug 2012 20:43:48 +0200 Subject: Update user_guide_src/source/libraries/form_validation.rst --- user_guide_src/source/libraries/form_validation.rst | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst index 3bcad7ba6..bc25d8292 100644 --- a/user_guide_src/source/libraries/form_validation.rst +++ b/user_guide_src/source/libraries/form_validation.rst @@ -488,6 +488,15 @@ the name of the function:: $this->form_validation->set_message('username_check') +If you are using an error message that can accept two $s in your error string, +such as .. + + $this->form_validation->set_message('min_length', 'The $s field must contain at least $s characters.'); + +Then you can also use %1$s and %2$s: + + $this->form_validation->set_message('min_length', 'This field must contain at least %2$s characters.'); + You can also override any error message found in the language file. For example, to change the message for the "required" rule you will do this:: -- cgit v1.2.3-24-g4f1b From f3fddf6e0f4b0b0976c433c139326bdcd45d2da0 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Fri, 31 Aug 2012 10:10:16 +0800 Subject: fix issue #1719 and update ip address length on captcha helper Signed-off-by: Bo-Yi Wu --- user_guide_src/source/libraries/trackback.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/trackback.rst b/user_guide_src/source/libraries/trackback.rst index 07b2b2177..f9e0df882 100644 --- a/user_guide_src/source/libraries/trackback.rst +++ b/user_guide_src/source/libraries/trackback.rst @@ -114,7 +114,7 @@ store them. Here is a basic prototype for such a table:: excerpt text NOT NULL, blog_name varchar(100) NOT NULL, tb_date int(10) NOT NULL, - ip_address varchar(16) NOT NULL, + ip_address varchar(45) NOT NULL, PRIMARY KEY `tb_id` (`tb_id`), KEY `entry_id` (`entry_id`) ); -- cgit v1.2.3-24-g4f1b From 7c70d10d699d7f7ecd446bf81c9e05de0811f282 Mon Sep 17 00:00:00 2001 From: pickupman Date: Sun, 2 Sep 2012 23:40:49 -0400 Subject: Fix #1741 is_unique duplicated in documentation for Form_validation --- user_guide_src/source/libraries/form_validation.rst | 1 - 1 file changed, 1 deletion(-) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst index 3bcad7ba6..39f787402 100644 --- a/user_guide_src/source/libraries/form_validation.rst +++ b/user_guide_src/source/libraries/form_validation.rst @@ -884,7 +884,6 @@ Rule Parameter Description 0, 1, 2, 3, etc. **is_natural_no_zero** No Returns FALSE if the form element contains anything other than a natural number, but not zero: 1, 2, 3, etc. -**is_unique** Yes Returns FALSE if the form element is not unique in a database table. is_unique[table.field] **valid_email** No Returns FALSE if the form element does not contain a valid email address. **valid_emails** No Returns FALSE if any value provided in a comma separated list is not a valid email. **valid_ip** No Returns FALSE if the supplied IP is not valid. -- cgit v1.2.3-24-g4f1b From 596e48d30d91c69a3a4a0bfbd059e8fa21d88ad1 Mon Sep 17 00:00:00 2001 From: Joe McFrederick Date: Tue, 4 Sep 2012 14:25:47 -0400 Subject: Add documation to user guide for Migrations class --- user_guide_src/source/libraries/migration.rst | 134 +++++++++++++++++++++++++- 1 file changed, 133 insertions(+), 1 deletion(-) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/migration.rst b/user_guide_src/source/libraries/migration.rst index 5192f1f29..cb7d96a6d 100644 --- a/user_guide_src/source/libraries/migration.rst +++ b/user_guide_src/source/libraries/migration.rst @@ -2,4 +2,136 @@ Migrations Class ################ -Coming soon. \ No newline at end of file +Migrations are a convenient way for you to alter your database in a +structured and organized manner. You could edit fragments of SQL by hand +but you would then be responsible for telling other developers that they +need to go and run them. You would also have to keep track of which changes +need to be run against the production machines next time you deploy. + +The database table **migration** tracks which migrations have already been +run so all you have to do is update your application files and +call **$this->migrate->current()** to work out which migrations should be run. +The current version is found in **config/migration.php**. + +****************** +Create a Migration +****************** + +.. note:: Each Migration is run in numerical order forward or backwards + depending on the method taken. Use a prefix of 3 numbers followed by an + underscore for the filename of your migration. + +This will be the first migration for a new site which has a blog. All +migrations go in the folder **application/migrations/** and have names such +as: **001_add_blog.php**.:: + + defined('BASEPATH') OR exit('No direct script access allowed'); + + class Migration_Add_blog extends CI_Migration { + + public function up() + { + $this->dbforge->add_field(array( + 'blog_id' => array( + 'type' => 'INT', + 'constraint' => 5, + 'unsigned' => TRUE, + 'auto_increment' => TRUE + ), + 'blog_title' => array( + 'type' => 'VARCHAR', + 'constraint' => '100', + ), + 'blog_description' => array( + 'type' => 'TEXT', + 'null' => TRUE, + ), + )); + + $this->dbforge->create_table('blog'); + } + + public function down() + { + $this->dbforge->drop_table('blog'); + } + +Then in **application/config/migration.php** set **$config['migration_version'] = 1;**. + +************* +Usage Example +************* + +In this example some simple code is placed in **application/controllers/migrate.php** +to update the schema.:: + + $this->load->library('migration'); + + if ( ! $this->migration->current()) + { + show_error($this->migration->error_string()); + } + +****************** +Function Reference +****************** + +There are five available methods for the Migration class: + +- $this->migration->current(); +- $this->migration->error_string(); +- $this->migration->find_migrations(); +- $this->migration->latest(); +- $this->migration->version(); + +$this->migration->current() +============================ + +The current migration is whatever is set for **$config['migration_version']** in +**application/config/migration.php**. + +$this->migration->error_string() +================================= + +This returns a string of errors while performing a migration. + +$this->migration->find_migrations() +==================================== + +An array of migration filenames are returned that are found in the **migration_path** +property. + +$this->migration->latest() +=========================== + +This works much the same way as current() but instead of looking for +the **$config['migration_version']** the Migration class will use the very +newest migration found in the filesystem. + +$this->migration->version() +============================ + +Version can be used to roll back changes or step forwards programmatically to +specific versions. It works just like current but ignores **$config['migration_version']**.:: + + $this->load->library('migration'); + + $this->migration->version(5); + +********************* +Migration Preferences +********************* + +The following is a table of all the config options for migrations. + +========================== ====================== ============= ============================================= +Preference Default Options Description +========================== ====================== ============= ============================================= +**migration_enabled** FALSE TRUE / FALSE Enable or disable migrations. +**migration_path** APPPATH.'migrations/' None The path to your migrations folder. +**migration_version** 0 None The current version your database should use. +**migration_table** migrations None The table name for storing the shema + version number. +**migration_auto_latest** FALSE TRUE / FALSE Enable or disable automatically + running migrations. +========================== ====================== ============= ============================================= -- cgit v1.2.3-24-g4f1b From 65bdaf5e2636cb7aa8780826529020ab0bfe9252 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Fri, 21 Sep 2012 13:49:09 +0800 Subject: Fixed pagination document error. Signed-off-by: Bo-Yi Wu --- user_guide_src/source/libraries/pagination.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/pagination.rst b/user_guide_src/source/libraries/pagination.rst index 7d750bd23..00554c1c7 100644 --- a/user_guide_src/source/libraries/pagination.rst +++ b/user_guide_src/source/libraries/pagination.rst @@ -80,7 +80,7 @@ The number of "digit" links you would like before and after the selected page number. For example, the number 2 will place two digits on either side, as in the example links at the very top of this page. -$config['use_page_number'] = TRUE; +$config['use_page_numbers'] = TRUE; ================================== By default, the URI segment will use the starting index for the items -- cgit v1.2.3-24-g4f1b From a5e329ff95e0308c07b8db04117f056081997796 Mon Sep 17 00:00:00 2001 From: "W. Kristianto" Date: Sun, 23 Sep 2012 22:34:18 +0700 Subject: Update user_guide_src/source/libraries/loader.rst Remove the second parameter --- user_guide_src/source/libraries/loader.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/loader.rst b/user_guide_src/source/libraries/loader.rst index 33c1bafec..615aba1c2 100644 --- a/user_guide_src/source/libraries/loader.rst +++ b/user_guide_src/source/libraries/loader.rst @@ -344,6 +344,6 @@ calling add_package_path(). $this->load->remove_package_path(APPPATH.'my_app'); // Again without the second parameter: - $this->load->add_package_path(APPPATH.'my_app', TRUE); + $this->load->add_package_path(APPPATH.'my_app'); $this->load->view('my_app_index'); // Loads $this->load->view('welcome_message'); // Loads -- cgit v1.2.3-24-g4f1b From 9438e26671ee1f0b49c8da7a56a0a195788fd5da Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 5 Oct 2012 13:16:27 +0300 Subject: Fix issue #116 + other space/style fixes [ci skip --- user_guide_src/source/libraries/image_lib.rst | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/image_lib.rst b/user_guide_src/source/libraries/image_lib.rst index ed6575c62..dcdccbd92 100644 --- a/user_guide_src/source/libraries/image_lib.rst +++ b/user_guide_src/source/libraries/image_lib.rst @@ -91,9 +91,9 @@ error upon failure, like this:: echo $this->image_lib->display_errors(); } -Note: You can optionally specify the HTML formatting to be applied to -the errors, by submitting the opening/closing tags in the function, like -this:: +.. note:: You can optionally specify the HTML formatting to be applied to + the errors, by submitting the opening/closing tags in the function, + like this:: $this->image_lib->display_errors('

', '

'); @@ -225,8 +225,7 @@ pixels) specifying where to crop, like this:: $config['y_axis'] = '40'; All preferences listed in the table above are available for this -function except these: rotation_angle, width, height, create_thumb, -new_image. +function except these: rotation_angle, create_thumb, new_image. Here's an example showing how you might crop an image:: @@ -243,11 +242,11 @@ Here's an example showing how you might crop an image:: echo $this->image_lib->display_errors(); } -Note: Without a visual interface it is difficult to crop images, so this -function is not very useful unless you intend to build such an -interface. That's exactly what we did using for the photo gallery module -in ExpressionEngine, the CMS we develop. We added a JavaScript UI that -lets the cropping area be selected. +.. note:: Without a visual interface it is difficult to crop images, so this + function is not very useful unless you intend to build such an + interface. That's exactly what we did using for the photo gallery module + in ExpressionEngine, the CMS we develop. We added a JavaScript UI that + lets the cropping area be selected. $this->image_lib->rotate() =========================== @@ -338,8 +337,8 @@ The above example will use a 16 pixel True Type font to create the text bottom/center of the image, 20 pixels from the bottom of the image. .. note:: In order for the image class to be allowed to do any - processing, the image file must have "write" file permissions. For - example, 777. + processing, the image file must have "write" file permissions + For example, 777. Watermarking Preferences ======================== -- cgit v1.2.3-24-g4f1b From 241a69be96de350b18d875304eb1e361b710e148 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 5 Oct 2012 14:58:36 +0300 Subject: [ci skip] Add a note to the user guide regarding issue #1010 --- user_guide_src/source/libraries/form_validation.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst index 39f787402..faf221981 100644 --- a/user_guide_src/source/libraries/form_validation.rst +++ b/user_guide_src/source/libraries/form_validation.rst @@ -861,8 +861,9 @@ Rule Parameter Description ========================= ========== ============================================================================================= ======================= **required** No Returns FALSE if the form element is empty. **matches** Yes Returns FALSE if the form element does not match the one in the parameter. matches[form_item] -**is_unique** Yes Returns FALSE if the form element is not unique to the is_unique[table.field] - table and field name in the parameter. is_unique[table.field] +**is_unique** Yes Returns FALSE if the form element is not unique to the table and field name in the is_unique[table.field] + parameter. Note: This rule requires :doc:`Query Builder ` to be + enabled in order to work. **max_length** Yes Returns FALSE if the form element is longer then the parameter value. max_length[12] **exact_length** Yes Returns FALSE if the form element is not exactly the parameter value. exact_length[8] **greater_than** Yes Returns FALSE if the form element is less than or equal to the parameter value or not greater_than[8] -- cgit v1.2.3-24-g4f1b From 6123b61e8ec95ac91f67bfbf442e34021c922319 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 5 Oct 2012 15:54:43 +0300 Subject: Fix issue #1340 [ci skip] --- user_guide_src/source/libraries/file_uploading.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/file_uploading.rst b/user_guide_src/source/libraries/file_uploading.rst index 65cd5c722..1698dcbb9 100644 --- a/user_guide_src/source/libraries/file_uploading.rst +++ b/user_guide_src/source/libraries/file_uploading.rst @@ -197,6 +197,7 @@ Preference Default Value Options Descripti Separate multiple types with a pipe. **file_name** None Desired file name If set CodeIgniter will rename the uploaded file to this name. The extension provided in the file name must also be an allowed file type. + If no extension is provided in the original file_name will be used. **overwrite** FALSE TRUE/FALSE (boolean) If set to true, if a file with the same name as the one you are uploading exists, it will be overwritten. If set to false, a number will be appended to the filename if another with the same name exists. -- cgit v1.2.3-24-g4f1b From ccd01c75f5802e4e4b74bb53414a58d2aa0fd0d8 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 5 Oct 2012 17:12:55 +0300 Subject: Polish changes from #1586 --- user_guide_src/source/libraries/email.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/email.rst b/user_guide_src/source/libraries/email.rst index fc324ffc9..e7ed9f74c 100644 --- a/user_guide_src/source/libraries/email.rst +++ b/user_guide_src/source/libraries/email.rst @@ -117,12 +117,12 @@ Sets the email address and name of the person sending the email:: $this->email->from('you@example.com', 'Your Name'); -:: +You can also set a Return-Path, to help redirect undelivered mail:: $this->email->from('you@example.com', 'Your Name', 'returned_emails@example.com'); -Third parameter is redirect for undelivered emails (may not be configured with -protocol 'smtp'). +.. note:: Return-Path can't be used if you've configured + 'smtp' as your protocol. $this->email->reply_to() ------------------------- -- cgit v1.2.3-24-g4f1b From 9e31f8f1600c6577f46a855eee6a3c7d527aebea Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 5 Oct 2012 17:31:46 +0300 Subject: Fix #1745 --- user_guide_src/source/libraries/form_validation.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst index 29e1be032..bc922e69b 100644 --- a/user_guide_src/source/libraries/form_validation.rst +++ b/user_guide_src/source/libraries/form_validation.rst @@ -489,11 +489,13 @@ the name of the function:: $this->form_validation->set_message('username_check') If you are using an error message that can accept two $s in your error string, -such as .. +such as: +:: $this->form_validation->set_message('min_length', 'The $s field must contain at least $s characters.'); Then you can also use %1$s and %2$s: +:: $this->form_validation->set_message('min_length', 'This field must contain at least %2$s characters.'); -- cgit v1.2.3-24-g4f1b From 73766c239318974b7e8ed02ab441794cab7f523f Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 5 Oct 2012 20:32:14 +0300 Subject: [ci skip] Small doc fixes, thanks dchill42 --- user_guide_src/source/libraries/pagination.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/pagination.rst b/user_guide_src/source/libraries/pagination.rst index 00554c1c7..d9d3f5092 100644 --- a/user_guide_src/source/libraries/pagination.rst +++ b/user_guide_src/source/libraries/pagination.rst @@ -81,7 +81,7 @@ page number. For example, the number 2 will place two digits on either side, as in the example links at the very top of this page. $config['use_page_numbers'] = TRUE; -================================== +=================================== By default, the URI segment will use the starting index for the items you are paginating. If you prefer to show the the actual page number, -- cgit v1.2.3-24-g4f1b From 92f00046751d44b3e938d6be1fc49017dd0e0040 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 5 Oct 2012 20:43:36 +0300 Subject: [ci skip] More doc fixes --- user_guide_src/source/libraries/form_validation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst index bc922e69b..14305b664 100644 --- a/user_guide_src/source/libraries/form_validation.rst +++ b/user_guide_src/source/libraries/form_validation.rst @@ -873,7 +873,7 @@ Rule Parameter Description **required** No Returns FALSE if the form element is empty. **matches** Yes Returns FALSE if the form element does not match the one in the parameter. matches[form_item] **is_unique** Yes Returns FALSE if the form element is not unique to the table and field name in the is_unique[table.field] - parameter. Note: This rule requires :doc:`Query Builder ` to be + parameter. Note: This rule requires :doc:`Query Builder <../database/query_builder>` to be enabled in order to work. **max_length** Yes Returns FALSE if the form element is longer then the parameter value. max_length[12] **exact_length** Yes Returns FALSE if the form element is not exactly the parameter value. exact_length[8] -- cgit v1.2.3-24-g4f1b From 956631d2b8f0f1173f55134b8465b41d2018edfa Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 6 Oct 2012 20:43:47 +0300 Subject: [ci skip] Alter some changelog entries --- user_guide_src/source/libraries/output.rst | 3 +++ 1 file changed, 3 insertions(+) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/output.rst b/user_guide_src/source/libraries/output.rst index 0472d14cf..3289a241f 100644 --- a/user_guide_src/source/libraries/output.rst +++ b/user_guide_src/source/libraries/output.rst @@ -105,6 +105,9 @@ Permits you to manually set a server status header. Example:: `See here `_ for a full list of headers. +.. note:: This method is an alias for :doc:`Common function <../general/common_funtions.rst>` + ``set_status_header()``. + $this->output->enable_profiler(); ================================== -- cgit v1.2.3-24-g4f1b From 960e616d18c77f463e7c53f666d98b09f5ca9057 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sun, 7 Oct 2012 15:48:55 +0300 Subject: Fix a typo [ci skip] --- user_guide_src/source/libraries/form_validation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src/source/libraries') diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst index 14305b664..22272dc9b 100644 --- a/user_guide_src/source/libraries/form_validation.rst +++ b/user_guide_src/source/libraries/form_validation.rst @@ -399,7 +399,7 @@ The validation system supports callbacks to your own validation functions. This permits you to extend the validation class to meet your needs. For example, if you need to run a database query to see if the user is choosing a unique username, you can create a callback function -that does that. Let's create a example of this. +that does that. Let's create an example of this. In your controller, change the "username" rule to this:: -- cgit v1.2.3-24-g4f1b