From 5a98a3dda56f6167f8241a7bc7d1c8784d98ccf9 Mon Sep 17 00:00:00 2001 From: Matteo Mattei Date: Thu, 15 Mar 2012 12:00:44 +0100 Subject: Email class: move string_attach() to attach() and add documentation --- user_guide_src/source/libraries/email.rst | 14 +++++++++++--- 1 file changed, 11 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 27b704dae..d05439a77 100644 --- a/user_guide_src/source/libraries/email.rst +++ b/user_guide_src/source/libraries/email.rst @@ -228,10 +228,18 @@ use the function multiple times. For example:: $this->email->attach('/path/to/photo2.jpg'); $this->email->attach('/path/to/photo3.jpg'); -If you'd like to change the disposition or add a custom file name, you can use the second and third paramaters. To use the default disposition (attachment), leave the second parameter blank. Here's an example:: +$filename, $str = '', $mime = '', $disposition = '', $newname = NULL +If you need to use a buffer string instead of a real (physical) file you can use the +second and third parameters that are respectively the buffer and the mime-type:: + + $this->email->attach('report.pdf', $buffer, 'application/pdf'); + +If you'd like to change the disposition or add a custom file name, you can use the +fourth and fifth paramaters. To use the default disposition (attachment), leave the +fourth parameter blank. Here's an example:: - $this->email->attach('/path/to/photo1.jpg', 'inline'); - $this->email->attach('/path/to/photo1.jpg', '', 'birthday.jpg'); + $this->email->attach('/path/to/photo1.jpg', '', '', 'inline'); + $this->email->attach('/path/to/photo1.jpg', '', '', '', 'birthday.jpg'); $this->email->print_debugger() -- cgit v1.2.3-24-g4f1b From df59c687a2243142e6da9d7b904523a1b91ca09b Mon Sep 17 00:00:00 2001 From: Matteo Mattei Date: Thu, 15 Mar 2012 16:03:58 +0100 Subject: Email class: adjust documentation and make the code backward compatible --- user_guide_src/source/libraries/email.rst | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 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 d05439a77..2be50fd35 100644 --- a/user_guide_src/source/libraries/email.rst +++ b/user_guide_src/source/libraries/email.rst @@ -228,19 +228,18 @@ use the function multiple times. For example:: $this->email->attach('/path/to/photo2.jpg'); $this->email->attach('/path/to/photo3.jpg'); -$filename, $str = '', $mime = '', $disposition = '', $newname = NULL +To use the default disposition (attachment), leave the second parameter blank. If you need to use a buffer string instead of a real (physical) file you can use the -second and third parameters that are respectively the buffer and the mime-type:: +third and fourth parameters that are respectively the buffer and the mime-type:: - $this->email->attach('report.pdf', $buffer, 'application/pdf'); + $this->email->attach('report.pdf', 'inline', $buffer, 'application/pdf'); -If you'd like to change the disposition or add a custom file name, you can use the -fourth and fifth paramaters. To use the default disposition (attachment), leave the -fourth parameter blank. Here's an example:: +If you'd like to add a custom file name, you can use the fifth paramaters. +Here's an example:: - $this->email->attach('/path/to/photo1.jpg', '', '', 'inline'); + $this->email->attach('/path/to/photo1.jpg', '', '', '', 'inline'); $this->email->attach('/path/to/photo1.jpg', '', '', '', 'birthday.jpg'); - + $this->email->print_debugger() ------------------------------- -- cgit v1.2.3-24-g4f1b From d18f552c53e3f55d091054a9dfb82faa989be8c4 Mon Sep 17 00:00:00 2001 From: leandronf Date: Thu, 22 Mar 2012 08:11:58 -0300 Subject: Update user_guide_src/source/libraries/email.rst --- user_guide_src/source/libraries/email.rst | 1 + 1 file changed, 1 insertion(+) (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 27b704dae..351b50d06 100644 --- a/user_guide_src/source/libraries/email.rst +++ b/user_guide_src/source/libraries/email.rst @@ -104,6 +104,7 @@ Preference Default Value Options Descript **newline** \\n "\\r\\n" or "\\n" or "\\r" Newline character. (Use "\\r\\n" to comply with RFC 822). **bcc_batch_mode** FALSE TRUE or FALSE (boolean) Enable BCC Batch Mode. **bcc_batch_size** 200 None Number of emails in each BCC batch. +**dsn** FALSE TRUE or FALSE (boolean) Enable notify message from server =================== ====================== ============================ ======================================================================= Email Function Reference -- cgit v1.2.3-24-g4f1b From be07c9292421e1e18afa8126de35bccdc0fdaaa0 Mon Sep 17 00:00:00 2001 From: leandronf Date: Thu, 22 Mar 2012 19:49:23 -0300 Subject: Update user_guide_src/source/libraries/email.rst --- user_guide_src/source/libraries/email.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 351b50d06..d7e40f5c4 100644 --- a/user_guide_src/source/libraries/email.rst +++ b/user_guide_src/source/libraries/email.rst @@ -104,7 +104,7 @@ Preference Default Value Options Descript **newline** \\n "\\r\\n" or "\\n" or "\\r" Newline character. (Use "\\r\\n" to comply with RFC 822). **bcc_batch_mode** FALSE TRUE or FALSE (boolean) Enable BCC Batch Mode. **bcc_batch_size** 200 None Number of emails in each BCC batch. -**dsn** FALSE TRUE or FALSE (boolean) Enable notify message from server +**dsn** FALSE TRUE or FALSE (boolean) Enable notify message from server =================== ====================== ============================ ======================================================================= Email Function Reference -- cgit v1.2.3-24-g4f1b From c3b36f4c6b8e8b15c96d6653ebdf07c76eb57d9e Mon Sep 17 00:00:00 2001 From: Matteo Mattei Date: Mon, 26 Mar 2012 10:27:17 +0200 Subject: Centralize handling of attach() function for both real file and buffer string. Update documentation. --- user_guide_src/source/libraries/email.rst | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 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 2be50fd35..19c2706d9 100644 --- a/user_guide_src/source/libraries/email.rst +++ b/user_guide_src/source/libraries/email.rst @@ -228,18 +228,20 @@ use the function multiple times. For example:: $this->email->attach('/path/to/photo2.jpg'); $this->email->attach('/path/to/photo3.jpg'); -To use the default disposition (attachment), leave the second parameter blank. -If you need to use a buffer string instead of a real (physical) file you can use the -third and fourth parameters that are respectively the buffer and the mime-type:: +To use the default disposition (attachment), leave the second parameter blank, +otherwise use a custom disposition:: - $this->email->attach('report.pdf', 'inline', $buffer, 'application/pdf'); + $this->email->attach('image.jpg', 'inline'); -If you'd like to add a custom file name, you can use the fifth paramaters. -Here's an example:: - - $this->email->attach('/path/to/photo1.jpg', '', '', '', 'inline'); - $this->email->attach('/path/to/photo1.jpg', '', '', '', 'birthday.jpg'); +If you'd like to use a custom file name, you can use the third paramater:: + $this->email->attach('filename.pdf', 'attachment', 'report.pdf'); + +If you need to use a buffer string instead of a real - physical - file you can +use the first parameter as buffer, the third parameter as file name and the fourth +parameter as mime-type:: + + $this->email->attach($buffer, 'attachment', 'report.pdf', 'application/pdf'); $this->email->print_debugger() ------------------------------- -- cgit v1.2.3-24-g4f1b From d8e1ac7c7fed6310669480fc5be58dff3a479cf5 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 26 Mar 2012 22:22:37 +0300 Subject: Fix some examples in the user guide --- user_guide_src/source/libraries/file_uploading.rst | 16 ++++++------- .../source/libraries/form_validation.rst | 4 ++-- user_guide_src/source/libraries/xmlrpc.rst | 28 ++++++++++++---------- 3 files changed, 25 insertions(+), 23 deletions(-) (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 90efca95d..d573fc770 100644 --- a/user_guide_src/source/libraries/file_uploading.rst +++ b/user_guide_src/source/libraries/file_uploading.rst @@ -90,24 +90,24 @@ this code and save it to your applications/controllers/ folder:: class Upload extends CI_Controller { - function __construct() + public function __construct() { parent::__construct(); $this->load->helper(array('form', 'url')); } - function index() + public function index() { $this->load->view('upload_form', array('error' => ' ' )); } - function do_upload() + public function do_upload() { - $config['upload_path'] = './uploads/'; - $config['allowed_types'] = 'gif|jpg|png'; - $config['max_size'] = '100'; - $config['max_width'] = '1024'; - $config['max_height'] = '768'; + $config['upload_path'] = './uploads/'; + $config['allowed_types'] = 'gif|jpg|png'; + $config['max_size'] = 100; + $config['max_width'] = 1024; + $config['max_height'] = 768; $this->load->library('upload', $config); diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst index 5d7368ccb..3e8855f60 100644 --- a/user_guide_src/source/libraries/form_validation.rst +++ b/user_guide_src/source/libraries/form_validation.rst @@ -123,7 +123,7 @@ this code and save it to your applications/controllers/ folder:: class Form extends CI_Controller { - function index() + public function index() { $this->load->helper(array('form', 'url')); @@ -219,7 +219,7 @@ Your controller should now look like this:: class Form extends CI_Controller { - function index() + public function index() { $this->load->helper(array('form', 'url')); diff --git a/user_guide_src/source/libraries/xmlrpc.rst b/user_guide_src/source/libraries/xmlrpc.rst index 3b945769f..dfb88114e 100644 --- a/user_guide_src/source/libraries/xmlrpc.rst +++ b/user_guide_src/source/libraries/xmlrpc.rst @@ -184,10 +184,10 @@ server will expect a class to exist with this prototype:: class My_blog extends CI_Controller { - function new_post($request) - { + public function new_post($request) + { - } + } } The $request variable is an object compiled by the Server, which @@ -304,7 +304,7 @@ folder:: class Xmlrpc_client extends CI_Controller { - function index() + public function index() { $this->load->helper('url'); $server_url = site_url('xmlrpc_server'); @@ -345,7 +345,7 @@ folder:: class Xmlrpc_server extends CI_Controller { - function index() + public function index() { $this->load->library('xmlrpc'); $this->load->library('xmlrpcs'); @@ -357,15 +357,17 @@ folder:: } - function process($request) + public function process($request) { $parameters = $request->output_parameters(); $response = array( - array( - 'you_said' => $parameters['0'], - 'i_respond' => 'Not bad at all.'), - 'struct'); + array( + 'you_said' => $parameters[0], + 'i_respond' => 'Not bad at all.' + ), + 'struct' + ); return $this->xmlrpc->send_response($response); } @@ -419,9 +421,9 @@ the Server. :: $parameters = $request->output_parameters(); - $name = $parameters['0']['name']; - $size = $parameters['1']['size']; - $size = $parameters['1']['shape']; + $name = $parameters[0]['name']; + $size = $parameters[1]['size']; + $size = $parameters[1]['shape']; ************************** XML-RPC Function Reference -- cgit v1.2.3-24-g4f1b From 52fe7bb68f9961cdd765dd38e54779ae3b66e586 Mon Sep 17 00:00:00 2001 From: Songpol Sripaoeiam Date: Sun, 1 Apr 2012 11:43:20 +0700 Subject: add function get_current_content_type to output class and user manual library --- user_guide_src/source/libraries/output.rst | 7 +++++++ 1 file changed, 7 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 2cf7c0854..8cd5ff895 100644 --- a/user_guide_src/source/libraries/output.rst +++ b/user_guide_src/source/libraries/output.rst @@ -49,6 +49,13 @@ data, JPEG's, XML, etc easily. .. important:: Make sure any non-mime string you pass to this method exists in config/mimes.php or it will have no effect. +$this->output->get_current_content_type(); +==================================== + +Get the current mime-type of your page and return 'text/html' by default. + + $this->output->get_current_content_type(); + $this->output->get_output(); ============================= -- cgit v1.2.3-24-g4f1b From b966701fad01c094199a89f7e4df72d981e5cf48 Mon Sep 17 00:00:00 2001 From: Songpol Sripaoeiam Date: Sun, 1 Apr 2012 17:13:44 +0700 Subject: bracket on a new line Also add space after foreach bracket on a new line... Also add a space after if Follow up from https://github.com/EllisLab/CodeIgniter/pull/1234/files#r630522 --- user_guide_src/source/libraries/output.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 8cd5ff895..ba1ef19e6 100644 --- a/user_guide_src/source/libraries/output.rst +++ b/user_guide_src/source/libraries/output.rst @@ -50,7 +50,7 @@ data, JPEG's, XML, etc easily. exists in config/mimes.php or it will have no effect. $this->output->get_current_content_type(); -==================================== +========================================== Get the current mime-type of your page and return 'text/html' by default. -- cgit v1.2.3-24-g4f1b From 614db07c77e341bfe4bf92d7576f01a6cabd43ff Mon Sep 17 00:00:00 2001 From: Songpol Sripaoeiam Date: Tue, 3 Apr 2012 01:29:28 +0700 Subject: The current name is too wide change to get_content_type()consistent with set_content_type() --- user_guide_src/source/libraries/output.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (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 ba1ef19e6..7fd2a1c72 100644 --- a/user_guide_src/source/libraries/output.rst +++ b/user_guide_src/source/libraries/output.rst @@ -49,12 +49,12 @@ data, JPEG's, XML, etc easily. .. important:: Make sure any non-mime string you pass to this method exists in config/mimes.php or it will have no effect. -$this->output->get_current_content_type(); +$this->output->get_content_type(); ========================================== Get the current mime-type of your page and return 'text/html' by default. - $this->output->get_current_content_type(); + $this->output->get_content_type(); $this->output->get_output(); ============================= -- cgit v1.2.3-24-g4f1b From 00adf1d480f94692a625ec2165e0fcc9171c6e2f Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 3 Apr 2012 12:30:50 +0300 Subject: Some improvements to the additions from pull #1234 --- user_guide_src/source/libraries/output.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (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 7fd2a1c72..baceaae7b 100644 --- a/user_guide_src/source/libraries/output.rst +++ b/user_guide_src/source/libraries/output.rst @@ -52,9 +52,11 @@ data, JPEG's, XML, etc easily. $this->output->get_content_type(); ========================================== -Get the current mime-type of your page and return 'text/html' by default. +Returns the Content-Type HTTP header that's currently in use. - $this->output->get_content_type(); + $mime = $this->output->get_content_type(); + +.. note:: If not set, the default return value is 'text/html'. $this->output->get_output(); ============================= -- cgit v1.2.3-24-g4f1b