<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>If Only I Knew That!</title>
	<atom:link href="http://ifonlyiknewthat.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ifonlyiknewthat.com</link>
	<description>Webby things that could save you time</description>
	<lastBuildDate>Thu, 03 Jun 2010 05:12:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Codeigniter 2.0 configurable profiler + some jQuery magic to show/hide</title>
		<link>http://ifonlyiknewthat.com/codeigniter/codeigniter-2-0-configurable-profiler-some-jquery-magic-to-showhide/</link>
		<comments>http://ifonlyiknewthat.com/codeigniter/codeigniter-2-0-configurable-profiler-some-jquery-magic-to-showhide/#comments</comments>
		<pubDate>Tue, 04 May 2010 03:22:27 +0000</pubDate>
		<dc:creator>daveganley</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://ifonlyiknewthat.com/?p=143</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>The new CI 2.0 Profiler has configurable sections + 2 new additional sections (http_headers and config).</p>
<p>You&#8217;ll need to edit application/config/profiler.php</p>
<pre class="brush: php;">
&lt;?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Profiler Sections
| -------------------------------------------------------------------------
| This file lets you determine whether or not various sections of Profiler
| data are displayed when the Profiler is enabled.
| Please see the user guide for info:
|
|	http://codeigniter.com/user_guide/general/profiling.html
|
*/

$config['benchmarks'] 		= TRUE;
$config['get'] 				= TRUE;
$config['memory_usage'] 	= TRUE;
$config['post'] 			= TRUE;
$config['uri_string']		= TRUE;
$config['controller_info']	= TRUE;
$config['queries'] 			= TRUE;
$config['http_headers'] 	= TRUE;
$config['config'] 			= TRUE;

/* End of file profiler.php */
/* Location: ./application/config/profiler.php */
</pre>
<p>I previously used a modified version of <a href="http://dragffy.com/blog/posts/making-codeigniters-profiler-ajax-compatible">MY_Profiler from dragffy.com</a>. I modified it to add a button to the top of the page that would show or hide the profiler when needed and could also hide the profiler button totally.<span id="more-143"></span></p>
<p>The screen grabs show hidden/visible states with benchmark section visible.</p>

<a href='http://ifonlyiknewthat.com/codeigniter/codeigniter-2-0-configurable-profiler-some-jquery-magic-to-showhide/attachment/hidden_profiler/' title='hidden_profiler'><img width="150" height="150" src="http://ifonlyiknewthat.com/wp-content/uploads/2010/05/hidden_profiler-150x150.png" class="attachment-thumbnail" alt="hidden_profiler" title="hidden_profiler" /></a>
<a href='http://ifonlyiknewthat.com/codeigniter/codeigniter-2-0-configurable-profiler-some-jquery-magic-to-showhide/attachment/visible_profiler/' title='visible_profiler'><img width="150" height="150" src="http://ifonlyiknewthat.com/wp-content/uploads/2010/05/visible_profiler-150x150.png" class="attachment-thumbnail" alt="visible_profiler" title="visible_profiler" /></a>

<p>Here is the code for anyone interested &#8211; credit to dragffy.com for original inspiration</p>
<pre class="brush: php;">
&lt;?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * Requires jquery in head of view
 *
 */
class MY_Profiler extends CI_Profiler {

 	function __construct($config = array())
 	{
 		parent::__construct($config);
 	}

	// --------------------------------------------------------------------

	/**
	 * Run the Profiler
	 *
	 * @access	private
	 * @return	string
	 */
	function run()
	{
		$output = &lt;&lt;&lt;ENDJS
&lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot;&gt;
// &lt; ![CDATA[
    $(function() {
		var profiler_html = $('#codeigniter_profiler').clone();
		var profiler_bar_html = $('#profiler_bar').clone();

        $('#codeigniter_profiler, #profiler_bar').remove();

		$('body').prepend(profiler_bar_html);
		$('body').append(profiler_html);

		$('#codeigniter_profiler').hide();
		$('#profiler_btn').click(function(){
			$('#codeigniter_profiler').toggle();

			if($('#codeigniter_profiler').is(':visible')) {
				$('#profiler_btn').text('HIDE PROFILER');
			} else {
				$('#profiler_btn').text('SHOW PROFILER');
			}

			return false;
		});
		$('#profiler_close_btn').click(function(){
			$('#profiler_bar, #codeigniter_profiler').hide();
			return false;
		});
    });
// ]]&gt;
&lt;/script&gt;
ENDJS;

		$output .= &quot;&lt;div id='profiler_bar' style='background-color: green; width: 150px; height: 20px; padding: 2px; position: absolute; top: 0; left: 20px; text-align: center; color: #FFF; font-family: Verdana, Geneva, sans-serif; filter: alpha(opacity=30); -moz-opacity: 0.30; opacity: 0.30;'&gt;&lt;a href='#' id='profiler_btn' style='color: #FFF; text-decoration: none;'&gt;SHOW PROFILER&lt;/a&gt;&lt;a href='#' id='profiler_close_btn' style='color: #FFF; text-decoration: none; margin-left:10px'&gt;X&lt;/a&gt;&lt;/div&gt;&quot;;

		$output .= &quot;&lt;div id='codeigniter_profiler' style='clear:both;background-color:#fff;padding:10px;'&gt;&quot;;
		$fields_displayed = 0;

		foreach ($this-&gt;_available_sections as $section)
		{
			if ($this-&gt;_compile_{$section} !== FALSE)
			{
				$func = &quot;_compile_{$section}&quot;;
				$output .= $this-&gt;{$func}();
				$fields_displayed++;
			}
		}

		if ($fields_displayed == 0)
		{
			$output .= '&lt;p style=&quot;border:1px solid #5a0099;padding:10px;margin:20px 0;background-color:#eee&quot;&gt;'.$this-&gt;CI-&gt;lang-&gt;line('profiler_no_profiles').'&lt;/p&gt;';
		}

		$output .= '&lt;/div&gt;';

		return $output;
	}

}

// END MY_Profiler class

/* End of file MY_Profiler.php */
/* Location: ./application/libraries/MY_Profiler.php */
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ifonlyiknewthat.com/codeigniter/codeigniter-2-0-configurable-profiler-some-jquery-magic-to-showhide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick and easy block commenting for testing</title>
		<link>http://ifonlyiknewthat.com/php/quick-and-easy-block-commenting-for-testing/</link>
		<comments>http://ifonlyiknewthat.com/php/quick-and-easy-block-commenting-for-testing/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 06:25:15 +0000</pubDate>
		<dc:creator>daveganley</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://ifonlyiknewthat.com/?p=137</guid>
		<description><![CDATA[To save time commenting and uncommenting during development we use a little trick with the comment block that allows us to add or remove a single character &#8216;\&#8217; to comment/uncomment a block. Uncommented /* */ Block of code /* */ Commented /* *\/ Block of code /* */ Quick and simple time saver]]></description>
			<content:encoded><![CDATA[<p>To save time commenting and uncommenting during development we use a little trick with the comment block that allows us to add or remove a single character &#8216;\&#8217; to comment/uncomment a block.</p>
<p>Uncommented</p>
<pre class="brush: php;">
/* */
Block of code
/* */
</pre>
<p>Commented</p>
<pre class="brush: php;">
/* *\/
Block of code
/* */
</pre>
<p>Quick and simple time saver</p>
]]></content:encoded>
			<wfw:commentRss>http://ifonlyiknewthat.com/php/quick-and-easy-block-commenting-for-testing/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CI-1.7.2 to CI-2.0 Model compatibility tweak</title>
		<link>http://ifonlyiknewthat.com/codeigniter/ci-1-7-2-to-ci-2-0-model-compatibility-tweak/</link>
		<comments>http://ifonlyiknewthat.com/codeigniter/ci-1-7-2-to-ci-2-0-model-compatibility-tweak/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 00:58:34 +0000</pubDate>
		<dc:creator>daveganley</dc:creator>
				<category><![CDATA[Codeigniter]]></category>

		<guid isPermaLink="false">http://ifonlyiknewthat.com/?p=124</guid>
		<description><![CDATA[Spotted this in Ben Edmunds Ion Auth model, great way of making your models CI-1.7.2+ compatible. // CI 2.0 Compatibility if(!class_exists('CI_Model')) { class CI_Model extends Model {} } class MY_Model extends CI_Model { }]]></description>
			<content:encoded><![CDATA[<p>Spotted this in <a href="http://github.com/benedmunds/CodeIgniter-Ion-Auth">Ben Edmunds Ion Auth</a> model, great way of making your models CI-1.7.2+ compatible. </p>
<pre class="brush: php;">
//  CI 2.0 Compatibility
if(!class_exists('CI_Model')) { class CI_Model extends Model {} }

class MY_Model extends CI_Model
{
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ifonlyiknewthat.com/codeigniter/ci-1-7-2-to-ci-2-0-model-compatibility-tweak/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up Codeigniter with dynamic configuration variables &#8211; fit for development teams</title>
		<link>http://ifonlyiknewthat.com/codeigniter/setting-up-codeigniter-with-dynamic-configuration-variables-fit-for-development-teams/</link>
		<comments>http://ifonlyiknewthat.com/codeigniter/setting-up-codeigniter-with-dynamic-configuration-variables-fit-for-development-teams/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 06:25:14 +0000</pubDate>
		<dc:creator>ronny</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[setup]]></category>

		<guid isPermaLink="false">http://ifonlyiknewthat.com/?p=98</guid>
		<description><![CDATA[When working in a team it is necessary to create dynamic configuration variables for Codeigniter so you can easily share code on development, staging and live servers. For example, in the team, each developer connects to a common development server (called &#8220;localhost&#8221;). There is a password protected remote staging server so clients can access it [...]]]></description>
			<content:encoded><![CDATA[<p>When working in a team it is necessary to create dynamic configuration variables for Codeigniter so you can easily share code on development, staging and live servers.</p>
<p>For example, in the team, each developer connects to a common development server (called &#8220;localhost&#8221;). There is a password protected remote staging server so clients can access it in parallel to the live site (eg. http://client.domain.com). The live site also has a public domain (eg. www.domain.com).  So we need 3 sets of &#8220;base_url&#8221; and &#8220;database&#8221; settings.<span id="more-98"></span></p>
<h3>Step 1:</h3>
<p>In &#8220;<strong>/application/config/config.php</strong>&#8220;, define the URL of the development and staging servers using static variables:</p>
<pre class="brush: php;">
define('DEV_SERVER_NAME', 'localhost');
define('STAGING_SERVER_NAME', 'http://client.domain.com');
</pre>
<h3>Step 2:</h3>
<p>Then add a switch and define the base url for each case:</p>
<pre class="brush: php;">
switch ($_SERVER['SERVER_NAME']) {
case DEV_SERVER_NAME:
  // development server
  $config['base_url']    = &quot;http://localhost/&quot;;
  break;
case STAGING_SERVER_NAME:
  // staging server
  $config['base_url']    = &quot;http://client.domain.com&quot;;
  break;
default:
  // live server
  $config['base_url']    = &quot;http://www.domain.com&quot;;
  break;
}
</pre>
<h3>Step 3:</h3>
<p>In &#8220;<strong>/application/config/database.php</strong>&#8221; add a switch to define the &#8220;active_group&#8221; for each case:</p>
<pre class="brush: php;">
switch ($_SERVER['SERVER_NAME']) {
case DEV_SERVER_NAME:
  // development server
  $active_group = &quot;local&quot;;
  break;
case STAGING_SERVER_NAME:
  // staging server
  $active_group = &quot;staging&quot;;
  break;
default:
  // live server
  $active_group = &quot;live&quot;;
  break;
}
</pre>
<h3>Step 4:</h3>
<p>Then add a set of settings for each active group:</p>
<pre class="brush: php;">
$db['local']['hostname'] = &quot;localhost&quot;;
$db['local']['username'] = &quot;DEV_USERNAME&quot;;
$db['local']['password'] = &quot;DEV_PASSWORD&quot;;
$db['local']['database'] = &quot;DEV_DATABASENAME&quot;;
$db['local']['dbdriver'] = &quot;mysql&quot;;
$db['local']['dbprefix'] = &quot;&quot;;
$db['local']['pconnect'] = FALSE;
$db['local']['db_debug'] = TRUE;
$db['local']['cache_on'] = FALSE;
$db['local']['cachedir'] = &quot;&quot;;
$db['local']['char_set'] = &quot;utf8&quot;;
$db['local']['dbcollat'] = &quot;utf8_general_ci&quot;;

$db['staging']['hostname'] = &quot;localhost&quot;;
$db['staging']['username'] = &quot;STG_USERNAME&quot;;
$db['staging']['password'] = &quot;STG_PASSWORD&quot;;
$db['staging']['database'] = &quot;STG_DATABASENAME&quot;;
$db['staging']['dbdriver'] = &quot;mysql&quot;;
$db['staging']['dbprefix'] = &quot;&quot;;
$db['staging']['pconnect'] = FALSE;
$db['staging']['db_debug'] = TRUE;
$db['staging']['cache_on'] = FALSE;
$db['staging']['cachedir'] = &quot;&quot;;
$db['staging']['char_set'] = &quot;utf8&quot;;
$db['staging']['dbcollat'] = &quot;utf8_general_ci&quot;;

$db['live']['hostname'] = &quot;localhost&quot;;
$db['live']['username'] = &quot;LIVE_USERNAME&quot;;
$db['live']['password'] = &quot;LIVE_PASSWORD&quot;;
$db['live']['database'] = &quot;LIVE_DATABASENAME&quot;;
$db['live']['dbdriver'] = &quot;mysql&quot;;
$db['live']['dbprefix'] = &quot;&quot;;
$db['live']['pconnect'] = FALSE;
$db['live']['db_debug'] = TRUE;
$db['live']['cache_on'] = FALSE;
$db['live']['cachedir'] = &quot;&quot;;
$db['live']['char_set'] = &quot;utf8&quot;;
$db['live']['dbcollat'] = &quot;utf8_general_ci&quot;;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ifonlyiknewthat.com/codeigniter/setting-up-codeigniter-with-dynamic-configuration-variables-fit-for-development-teams/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reduce Bandwidth with mod_deflate and .htaccess</title>
		<link>http://ifonlyiknewthat.com/apache/reduce-bandwidth-with-mod_deflate-and-htaccess/</link>
		<comments>http://ifonlyiknewthat.com/apache/reduce-bandwidth-with-mod_deflate-and-htaccess/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 06:24:53 +0000</pubDate>
		<dc:creator>ronny</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[optimisation]]></category>

		<guid isPermaLink="false">http://ifonlyiknewthat.com/?p=110</guid>
		<description><![CDATA[There is something called mod_deflate for Apache 2.x that helps to do auto compression. This is particularly helpful in reducing bandwidth of those nasty jquery plugins. Step 1: Add this to the config file (eg. httpd.conf) and then reload Apache LoadModule deflate_module modules/mod_deflate.so Step 2: Then add this to the .htaccess file (to automatically compress [...]]]></description>
			<content:encoded><![CDATA[<p>There is something called mod_deflate for Apache 2.x <span>that</span> helps to do auto compression. This is particularly helpful in reducing bandwidth of those nasty jquery plugins.</p>
<h3>Step 1:</h3>
<p>Add this to the config file (eg. httpd.conf) and then reload Apache</p>
<pre class="brush: php;">
LoadModule deflate_module modules/mod_deflate.so
</pre>
<h3>Step 2:</h3>
<p>Then add this to the .htaccess file (to automatically compress javascript, css, html and xml):</p>
<pre class="brush: php;">
&lt;Module mod_deflate.c&gt;
AddOutputFilterByType DEFLATE application/x-javascript text/css text/html text/xml
&lt;/IfModule&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ifonlyiknewthat.com/apache/reduce-bandwidth-with-mod_deflate-and-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New site built on Codeigniter</title>
		<link>http://ifonlyiknewthat.com/codeigniter/new-site-built-on-codeigniter/</link>
		<comments>http://ifonlyiknewthat.com/codeigniter/new-site-built-on-codeigniter/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 23:13:38 +0000</pubDate>
		<dc:creator>daveganley</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[production]]></category>

		<guid isPermaLink="false">http://ifonlyiknewthat.com/?p=91</guid>
		<description><![CDATA[Not really a webby thing that could save you time but yesterday we finished a 2 phase build. Phase 1: A user backend as such, consisting of a 7 part entry form including ajax image cropping, lots of custom validation and conditional form elements. Phase 2: The frontend, uses Infinite scroll to create a single [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.healthylifeawards.com.au/"><img src="http://ifonlyiknewthat.com/wp-content/uploads/2009/08/Healthy-Life-Awards.jpg" alt="Healthy Life Awards" title="Healthy Life Awards" width="485" height="449" class="alignnone size-full wp-image-92" /></a></p>
<p>Not really a webby thing that could save you time but yesterday we finished a 2 phase build.</p>
<p>Phase 1: A user backend as such, consisting of a 7 part entry form including ajax image cropping, lots of custom validation and conditional form elements.</p>
<p>Phase 2: The frontend, uses <a href="http://www.infinite-scroll.com/infinite-scroll-jquery-plugin/">Infinite scroll</a> to create a single page of user profiles, there is also a ajax rating system.</p>
<p>Codeigniter allowed use to build the site in 6 weeks, with 3 solid weeks dev on the forms. All the JS is jQuery based.</p>
<p>Check it out for yourself <a href="http://www.healthylifeawards.com.au/">healthy life awards</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ifonlyiknewthat.com/codeigniter/new-site-built-on-codeigniter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An improved .htaccess file to remove index.php in CI</title>
		<link>http://ifonlyiknewthat.com/codeigniter/an-improved-htaccess-file-to-remove-indexphp-in-ci/</link>
		<comments>http://ifonlyiknewthat.com/codeigniter/an-improved-htaccess-file-to-remove-indexphp-in-ci/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 22:43:15 +0000</pubDate>
		<dc:creator>daveganley</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[setup]]></category>
		<category><![CDATA[URI]]></category>

		<guid isPermaLink="false">http://ifonlyiknewthat.com/?p=87</guid>
		<description><![CDATA[A quick update of the .htaccess to remove the index.php, while still protecting the application folder. The previous method I used meant having to add every real file or directory to the .htaccess to allow them to be accessed. The updated way checks if the requested file/directory exists and if need rewrites to the index.php. [...]]]></description>
			<content:encoded><![CDATA[<p>A quick update of the .htaccess to remove the index.php, while still protecting the application folder.</p>
<p>The previous method I used meant having to add every real file or directory to the .htaccess to allow them to be accessed. The updated way checks if the requested file/directory exists and if need rewrites to the index.php.</p>
<p>If you need to protect more directories separate them with | i.e. application|modules </p>
<pre class="brush: php;">
RewriteEngine On
RewriteRule ^(application) - [F,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ifonlyiknewthat.com/codeigniter/an-improved-htaccess-file-to-remove-indexphp-in-ci/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adding Meta data to a codeigniter view from a controller</title>
		<link>http://ifonlyiknewthat.com/codeigniter/adding-meta-data-to-a-codeigniter-view-from-a-controller/</link>
		<comments>http://ifonlyiknewthat.com/codeigniter/adding-meta-data-to-a-codeigniter-view-from-a-controller/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 05:00:21 +0000</pubDate>
		<dc:creator>daveganley</dc:creator>
				<category><![CDATA[Codeigniter]]></category>

		<guid isPermaLink="false">http://ifonlyiknewthat.com/?p=74</guid>
		<description><![CDATA[To make adding meta data to a view easier, in the controller add to your method $meta = array ( 'meta_title' =&#62; 'title here', 'meta_keywords' =&#62; 'keywords here', 'meta_description' =&#62; 'description here', 'meta_robots' =&#62; 'all', 'extra_headers' =&#62; ' &#60;script src=&#34;http://www.google.com/jsapi&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62; &#60;script type=&#34;text/javascript&#34;&#62; &#60;!-- google.load(&#34;jquery&#34;, &#34;1.3.2&#34;); --&#62; &#60;/script&#62;' ); $data = array(); // add any [...]]]></description>
			<content:encoded><![CDATA[<p>To make adding meta data to a view easier, in the controller add to your method</p>
<pre class="brush: php;">
$meta = array (
			'meta_title' 			=&gt; 'title here',
			'meta_keywords' 		=&gt; 'keywords here',
			'meta_description' 		=&gt; 'description here',
			'meta_robots' 			=&gt; 'all',
			'extra_headers' 		=&gt; '
				    &lt;script src=&quot;http://www.google.com/jsapi&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
				    &lt;script type=&quot;text/javascript&quot;&gt;
				     	&lt;!--
				     	google.load(&quot;jquery&quot;, &quot;1.3.2&quot;);
				     	--&gt;
				    &lt;/script&gt;'
		);

		$data = array();
		// add any data

		// merge meta and data
		$data = array_merge($data,$meta);

		// load view with data
		$this-&gt;load-&gt;view('pages/home', $data);
</pre>
<p>The extra header allows adding additional JS and CSS to the specific view</p>
<p>In your view add the following head code</p>
<pre class="brush: php;">
&lt;head&gt;
    &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
    &lt;title&gt;&lt;?php if(isset($meta_title)) echo $meta_title; ?&gt;&lt;/title&gt;
    &lt;meta name=&quot;keywords&quot; content=&quot;&lt;?php if(isset($meta_keywords)) echo $meta_keywords; ?&gt;&quot; /&gt;
    &lt;meta name=&quot;description&quot; content=&quot;&lt;?php if(isset($meta_description)) echo $meta_description; ?&gt;&quot; /&gt;
    &lt;meta name=&quot;robots&quot; content=&quot;&lt;?php if(isset($meta_robots)) echo $meta_robots; ?&gt;&quot; /&gt;

    &lt;?php if(isset($extra_headers)) echo $extra_headers; ?&gt;
&lt;/head&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ifonlyiknewthat.com/codeigniter/adding-meta-data-to-a-codeigniter-view-from-a-controller/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Switching codeigniter profiler on/off globally</title>
		<link>http://ifonlyiknewthat.com/codeigniter/switching-codeigniter-profiler-onoff-globally/</link>
		<comments>http://ifonlyiknewthat.com/codeigniter/switching-codeigniter-profiler-onoff-globally/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 04:06:26 +0000</pubDate>
		<dc:creator>daveganley</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[setup]]></category>
		<category><![CDATA[staging]]></category>

		<guid isPermaLink="false">http://ifonlyiknewthat.com/?p=60</guid>
		<description><![CDATA[In my post regarding setting up codeigniter, I created a debug setting in /application/config/application.php /* &#124;-------------------------------------------------------------------------- &#124; Debug &#124;-------------------------------------------------------------------------- */ $config['debug'] = TRUE; in the constructor of every controller I add $this-&#62;output-&#62;enable_profiler($this-&#62;config-&#62;item('debug')); Now all I have to do is change the value in the application config to enable/disable profiling globally]]></description>
			<content:encoded><![CDATA[<p>In my post regarding <a href="/codeigniter/setting-up-codeigniter/">setting up codeigniter</a>, I created a debug setting in /application/config/application.php</p>
<pre class="brush: php;">
/*
|--------------------------------------------------------------------------
| Debug
|--------------------------------------------------------------------------
*/
$config['debug']	= TRUE;
</pre>
<p>in the constructor of every controller I add</p>
<pre class="brush: php;">
$this-&gt;output-&gt;enable_profiler($this-&gt;config-&gt;item('debug'));
</pre>
<p>Now all I have to do is change the value in the application config to enable/disable profiling globally</p>
]]></content:encoded>
			<wfw:commentRss>http://ifonlyiknewthat.com/codeigniter/switching-codeigniter-profiler-onoff-globally/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Codeigniter URI routing to give impression of directories</title>
		<link>http://ifonlyiknewthat.com/codeigniter/codeigniter-uri-routing-to-give-impression-of-directories/</link>
		<comments>http://ifonlyiknewthat.com/codeigniter/codeigniter-uri-routing-to-give-impression-of-directories/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 00:49:02 +0000</pubDate>
		<dc:creator>daveganley</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[URI]]></category>

		<guid isPermaLink="false">http://ifonlyiknewthat.com/?p=45</guid>
		<description><![CDATA[I recently had to create a codeigniter site with three main sections and two of the sections needed to appear in directories in the URL&#8217;s The main site Backend user dashboard Backend user admin All the main site pages were available via top level URL&#8217;s, nothing new there with the standard codeigniter routing http://example.com/about http://example.com/join [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to create a codeigniter site with three main sections and two of the sections needed to appear in directories in the URL&#8217;s</p>
<ul>
<li>The main site</li>
<li>Backend user dashboard</li>
<li>Backend user admin</li>
</ul>
<p><span id="more-45"></span><br />
All the main site pages were available via top level URL&#8217;s, nothing new there with the standard codeigniter routing</p>
<pre class="brush: php;">

http://example.com/about

http://example.com/join
</pre>
<p>these simply route to</p>
<pre class="brush: php;">
/application/controller/about.php
/application/controller/join.php
</pre>
<p>The backend dashboard needed to appear to be in a &#8216;dashboard&#8217; directory like so</p>
<pre class="brush: php;">

http://example.com/dashboard/events
</pre>
<p>these route to</p>
<pre class="brush: php;">
/application/controller/events.php
</pre>
<p>and finally there was a admin section within the dashboard section and the URL&#8217;s looked like so</p>
<pre class="brush: php;">

http://example.com/dashboard/admin/events/add

http://example.com/dashboard/admin/events/delete
</pre>
<p>these routed to</p>
<pre class="brush: php;">
/application/controller/admin_events.php
</pre>
<p>the <em>admin_</em>  was required to prevent the events controller conflicting but I didn&#8217;t want <em>admin_events<br />
</em> to be part of the URL.</p>
<p>So to allow the directory based URL&#8217;s and remove the requirement to show the <em>admin_</em> in the URL to call the right controller, a little work in the /application/config/routes.php was required.</p>
<pre class="brush: php;">
$route['^dashboard/admin/(.+)$'] = &quot;admin_$1&quot;;
$route['^dashboard/(.+)$'] = &quot;$1&quot;;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ifonlyiknewthat.com/codeigniter/codeigniter-uri-routing-to-give-impression-of-directories/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
