summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'user_guide_src/source/libraries')
-rw-r--r--user_guide_src/source/libraries/email.rst20
-rw-r--r--user_guide_src/source/libraries/file_uploading.rst16
-rw-r--r--user_guide_src/source/libraries/form_validation.rst25
-rw-r--r--user_guide_src/source/libraries/javascript.rst4
-rw-r--r--user_guide_src/source/libraries/output.rst9
-rw-r--r--user_guide_src/source/libraries/sessions.rst4
-rw-r--r--user_guide_src/source/libraries/table.rst2
-rw-r--r--user_guide_src/source/libraries/xmlrpc.rst28
8 files changed, 71 insertions, 37 deletions
diff --git a/user_guide_src/source/libraries/email.rst b/user_guide_src/source/libraries/email.rst
index 27b704dae..daf000907 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
@@ -228,11 +229,20 @@ 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::
-
- $this->email->attach('/path/to/photo1.jpg', 'inline');
- $this->email->attach('/path/to/photo1.jpg', '', 'birthday.jpg');
-
+To use the default disposition (attachment), leave the second parameter blank,
+otherwise use a custom disposition::
+
+ $this->email->attach('image.jpg', 'inline');
+
+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()
-------------------------------
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 5aa64d032..028b61c4c 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'));
@@ -321,7 +321,7 @@ password to MD5, and running the username through the "xss_clean"
function, which removes malicious data.
**Any native PHP function that accepts one parameter can be used as a
-rule, like htmlspecialchars, trim, MD5, etc.**
+rule, like htmlspecialchars, trim, md5, etc.**
.. note:: You will generally want to use the prepping functions
**after** the validation rules so if there is an error, the original
@@ -523,7 +523,7 @@ Changing the Error Delimiters
By default, the Form Validation class adds a paragraph tag (<p>) around
each error message shown. You can either change these delimiters
-globally or individually.
+globally, individually, or change the defaults in a config file.
#. **Changing delimiters Globally**
To globally change the error delimiters, in your controller function,
@@ -543,6 +543,12 @@ globally or individually.
<?php echo validation_errors('<div class="error">', '</div>'); ?>
+#. **Set delimiters in a config file**
+ You can add your error delimiters in application/config/form_validation.php as follows::
+
+ $config['error_prefix'] = '<div class="error_prefix">';
+ $config['error_suffix'] = '</div>';
+
Showing Errors Individually
===========================
@@ -602,7 +608,7 @@ call the reset_validation() function before setting up rules and validating the
For more info please see the :ref:`function-reference` section below.
--.. _saving-groups:
+.. _saving-groups:
************************************************
Saving Sets of Validation Rules to a Config File
@@ -869,7 +875,7 @@ Rule Parameter Description
underscores or dashes.
**numeric** No Returns FALSE if the form element contains anything other than numeric characters.
**integer** No Returns FALSE if the form element contains anything other than an integer.
-**decimal** Yes Returns FALSE if the form element is not exactly the parameter value.
+**decimal** No Returns FALSE if the form element contains anything other than a decimal number.
**is_natural** No Returns FALSE if the form element contains anything other than a natural number:
0, 1, 2, 3, etc.
**is_natural_no_zero** No Returns FALSE if the form element contains anything other than a natural
@@ -886,8 +892,9 @@ Rule Parameter Description
$this->form_validation->required($string);
-.. note:: You can also use any native PHP functions that permit one
- parameter.
+.. note:: You can also use any native PHP functions that permit up
+ to two parameters, where at least one is required (to pass
+ the field data).
******************
Prepping Reference
@@ -970,7 +977,7 @@ $this->form_validation->set_data();
$_POST array.
$this->form_validation->reset_validation();
-========================================
+===========================================
.. php:method:: reset_validation ()
diff --git a/user_guide_src/source/libraries/javascript.rst b/user_guide_src/source/libraries/javascript.rst
index 5e80fb998..d5e09c314 100644
--- a/user_guide_src/source/libraries/javascript.rst
+++ b/user_guide_src/source/libraries/javascript.rst
@@ -86,14 +86,14 @@ The jQuery Class
To initialize the jQuery class manually in your controller constructor,
use the $this->load->library function::
- $this->load->library('jquery');
+ $this->load->library('javascript/jquery');
You may send an optional parameter to determine whether or not a script
tag for the main jQuery file will be automatically included when loading
the library. It will be created by default. To prevent this, load the
library as follows::
- $this->load->library('jquery', FALSE);
+ $this->load->library('javascript/jquery', FALSE);
Once loaded, the jQuery library object will be available using:
$this->jquery
diff --git a/user_guide_src/source/libraries/output.rst b/user_guide_src/source/libraries/output.rst
index 2cf7c0854..baceaae7b 100644
--- a/user_guide_src/source/libraries/output.rst
+++ b/user_guide_src/source/libraries/output.rst
@@ -49,6 +49,15 @@ 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_content_type();
+==========================================
+
+Returns the Content-Type HTTP header that's currently in use.
+
+ $mime = $this->output->get_content_type();
+
+.. note:: If not set, the default return value is 'text/html'.
+
$this->output->get_output();
=============================
diff --git a/user_guide_src/source/libraries/sessions.rst b/user_guide_src/source/libraries/sessions.rst
index ef32f5d71..e8332ee97 100644
--- a/user_guide_src/source/libraries/sessions.rst
+++ b/user_guide_src/source/libraries/sessions.rst
@@ -209,6 +209,10 @@ set_userdata().
To read a flashdata variable::
$this->session->flashdata('item');
+
+An array of all flashdata can be retrieved as follows::
+
+ $this->session->all_flashdata();
If you find that you need to preserve a flashdata variable through an
diff --git a/user_guide_src/source/libraries/table.rst b/user_guide_src/source/libraries/table.rst
index 9bc3f3423..6a808abc2 100644
--- a/user_guide_src/source/libraries/table.rst
+++ b/user_guide_src/source/libraries/table.rst
@@ -116,6 +116,8 @@ example, only the table opening tag is being changed::
$tmpl = array ( 'table_open' => '<table border="1" cellpadding="2" cellspacing="1" class="mytable">' );
$this->table->set_template($tmpl);
+
+You can also set defaults for these in a config file.
******************
Function Reference
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