From 61bb5012ba51ebbe5af11ef9d21741474f9f970d Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sun, 11 Sep 2011 14:35:52 +0800 Subject: update user guide for replacing 'br/' with 'br /' --- user_guide/libraries/output.html | 14 +++++++------- user_guide/libraries/user_agent.html | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'user_guide/libraries') diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index 7361d7961..64ba482ce 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -82,12 +82,12 @@ For example, if you build a page in one of your controller functions, don't set

Permits you to set the mime-type of your page so you can serve JSON data, JPEG's, XML, etc easily.

-$this->output
-    ->set_content_type('application/json')
-    ->set_output(json_encode(array('foo' => 'bar')));
-
-$this->output
-    ->set_content_type('jpeg') // You could also use ".jpeg" which will have the full stop removed before looking in config/mimes.php
+$this->output
+    ->set_content_type('application/json')
+    ->set_output(json_encode(array('foo' => 'bar')));
+
+$this->output
+    ->set_content_type('jpeg') // You could also use ".jpeg" which will have the full stop removed before looking in config/mimes.php
    ->set_output(file_get_contents('files/something.jpg'));

Important: Make sure any non-mime string you pass to this method exists in config/mimes.php or it will have no effect.

@@ -174,4 +174,4 @@ Next Topic:  Pagination Class - \ No newline at end of file + diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html index e1d3640d3..d6641c883 100644 --- a/user_guide/libraries/user_agent.html +++ b/user_guide/libraries/user_agent.html @@ -133,7 +133,7 @@ You can find this list in application/config/user_agents.php if you w else if ($this->agent->is_mobile())
{
    $this->load->view('mobile/home');
-}
+}
else
{
    $this->load->view('web/home');
@@ -223,4 +223,4 @@ Next Topic:  XML-RPC Class - \ No newline at end of file + -- cgit v1.2.3-24-g4f1b From 869e3721d75e9798a706d24d93170f44e5ab6cb3 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Sun, 11 Sep 2011 14:00:26 -0400 Subject: Changed the add_package_path documentation to show the second param for view path loading. --- user_guide/libraries/loader.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'user_guide/libraries') diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index af27176ad..98864a700 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -241,9 +241,9 @@ $this->load->library('foo_bar');

In this instance, it is possible for view naming collisions within packages to occur, and possibly the incorrect package being loaded. To ensure against this, set an optional second parameter of FALSE when calling add_package_path().

-$this->load->add_package_path(APPPATH.'my_app', TRUE);
+$this->load->add_package_path(APPPATH.'my_app', FALSE);
$this->load->view('my_app_index'); // Loads
-$this->load->view('welcome_message'); // Will not load the default welcome_message b/c the second param to add_package_path is TRUE
+$this->load->view('welcome_message'); // Will not load the default welcome_message b/c the second param to add_package_path is FALSE

// Reset things
$this->load->remove_package_path(APPPATH.'my_app');
-- cgit v1.2.3-24-g4f1b