<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: CodeIgniter: Organizing views simply</title>
	<atom:link href="http://www.askaboutphp.com/48/codeigniter-organizing-views-simply.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.askaboutphp.com/48/codeigniter-organizing-views-simply.html</link>
	<description></description>
	<lastBuildDate>Sun, 05 Sep 2010 17:36:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: SNG</title>
		<link>http://www.askaboutphp.com/48/codeigniter-organizing-views-simply.html/comment-page-1#comment-23677</link>
		<dc:creator>SNG</dc:creator>
		<pubDate>Sun, 08 Aug 2010 13:42:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.askaboutphp.com/?p=48#comment-23677</guid>
		<description>In our office, we have a nickname for this. We call this idea tiling. Let the master view decide where it will put the sub views. The idea presented in CI doc is more like slicing. You have to call the slices in proper order and have to decide how much goes to header and how much in footer.</description>
		<content:encoded><![CDATA[<p>In our office, we have a nickname for this. We call this idea tiling. Let the master view decide where it will put the sub views. The idea presented in CI doc is more like slicing. You have to call the slices in proper order and have to decide how much goes to header and how much in footer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: syabac</title>
		<link>http://www.askaboutphp.com/48/codeigniter-organizing-views-simply.html/comment-page-1#comment-22740</link>
		<dc:creator>syabac</dc:creator>
		<pubDate>Sat, 10 Jul 2010 04:41:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.askaboutphp.com/?p=48#comment-22740</guid>
		<description>thanks for sharing.
nice tutorial, simple and clear..</description>
		<content:encoded><![CDATA[<p>thanks for sharing.<br />
nice tutorial, simple and clear..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.askaboutphp.com/48/codeigniter-organizing-views-simply.html/comment-page-1#comment-22647</link>
		<dc:creator>David</dc:creator>
		<pubDate>Wed, 07 Jul 2010 08:31:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.askaboutphp.com/?p=48#comment-22647</guid>
		<description>hello, think for this nice trick! :)

I have add some little things :
a global class for all page datas 
and automatic passing datas to page in container :


// --- library ---

class PageDatas {
	var $titlePage=&#039;&#039;;
	var $viewPage=&#039;&#039;;
	var $datas=array();
}



so in controller I just pass this object :

// --- controller ---

$pageDatas = new PageDatas();
$pageDatas-&gt;titlePage = &#039;Tribe&#039;;

// datas contents for page
$datas[&#039;contents&#039;]=$this-&gt;ContentModel-&gt;fetchAllContents();
$pageDatas-&gt;datas =$datas; 

// view page		
$pageDatas-&gt;viewPage = &#039;content/index&#039;;
$this-&gt;load-&gt;view(&#039;layer/container&#039;, array(&#039;pageDatas&#039;=&gt;$pageDatas));


and in container I pass the pageDatas to header, footer...
and direct datas to the page :

// --- container ---

load-&gt;view(&#039;layer/header&#039;, array(&#039;pageDatas&#039;=&gt;$pageDatas)); ?&gt;

load-&gt;view($pageDatas-&gt;viewPage, $pageDatas-&gt;datas); ?&gt;


hope it can help ^^</description>
		<content:encoded><![CDATA[<p>hello, think for this nice trick! <img src='http://www.askaboutphp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I have add some little things :<br />
a global class for all page datas<br />
and automatic passing datas to page in container :</p>
<p>// &#8212; library &#8212;</p>
<p>class PageDatas {<br />
	var $titlePage=&#8221;;<br />
	var $viewPage=&#8221;;<br />
	var $datas=array();<br />
}</p>
<p>so in controller I just pass this object :</p>
<p>// &#8212; controller &#8212;</p>
<p>$pageDatas = new PageDatas();<br />
$pageDatas-&gt;titlePage = &#8216;Tribe&#8217;;</p>
<p>// datas contents for page<br />
$datas['contents']=$this-&gt;ContentModel-&gt;fetchAllContents();<br />
$pageDatas-&gt;datas =$datas; </p>
<p>// view page<br />
$pageDatas-&gt;viewPage = &#8216;content/index&#8217;;<br />
$this-&gt;load-&gt;view(&#8216;layer/container&#8217;, array(&#8216;pageDatas&#8217;=&gt;$pageDatas));</p>
<p>and in container I pass the pageDatas to header, footer&#8230;<br />
and direct datas to the page :</p>
<p>// &#8212; container &#8212;</p>
<p>load-&gt;view(&#8216;layer/header&#8217;, array(&#8216;pageDatas&#8217;=&gt;$pageDatas)); ?&gt;</p>
<p>load-&gt;view($pageDatas-&gt;viewPage, $pageDatas-&gt;datas); ?&gt;</p>
<p>hope it can help ^^</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Heath</title>
		<link>http://www.askaboutphp.com/48/codeigniter-organizing-views-simply.html/comment-page-1#comment-22123</link>
		<dc:creator>Heath</dc:creator>
		<pubDate>Sun, 20 Jun 2010 01:29:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.askaboutphp.com/?p=48#comment-22123</guid>
		<description>Thanks for the tut, i have only just found CI am very excited about it. I was concerned about the templating until I read your article, now I am stoked!</description>
		<content:encoded><![CDATA[<p>Thanks for the tut, i have only just found CI am very excited about it. I was concerned about the templating until I read your article, now I am stoked!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Page template in CodeIgniter &#171; CodeIgniter Lab</title>
		<link>http://www.askaboutphp.com/48/codeigniter-organizing-views-simply.html/comment-page-1#comment-21559</link>
		<dc:creator>Page template in CodeIgniter &#171; CodeIgniter Lab</dc:creator>
		<pubDate>Thu, 27 May 2010 04:50:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.askaboutphp.com/?p=48#comment-21559</guid>
		<description>[...] Ask about PHP shared their method of how to have a template with just using normal view in CodeIgniter. Their explanation was here. [...]</description>
		<content:encoded><![CDATA[<p>[...] Ask about PHP shared their method of how to have a template with just using normal view in CodeIgniter. Their explanation was here. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aziz Light</title>
		<link>http://www.askaboutphp.com/48/codeigniter-organizing-views-simply.html/comment-page-1#comment-18142</link>
		<dc:creator>Aziz Light</dc:creator>
		<pubDate>Tue, 05 Jan 2010 16:12:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.askaboutphp.com/?p=48#comment-18142</guid>
		<description>I&#039;ve been doing this for a long long time, so it seem like common knowledge for me. Nice tut anyway.

You could go one step furher though. What if you want to change the main view (the one you called &#039;container&#039;), you would have to change the name in every action of every controller where you loaded the view. Instead, what you should do is extend the Controller, and in its constructor, set the name of your main view (&#039;container&#039; in this case).

Then instead of extending Controller, you would extend MY_Controller (or whatever you called it), and when you load the view you would have someting like this:

$this-&gt;load-&gt;view($this-&gt;container, $data);

This way you can change the main view easily, and you can even go further and create a small templating engine based on that principle.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve been doing this for a long long time, so it seem like common knowledge for me. Nice tut anyway.</p>
<p>You could go one step furher though. What if you want to change the main view (the one you called &#8216;container&#8217;), you would have to change the name in every action of every controller where you loaded the view. Instead, what you should do is extend the Controller, and in its constructor, set the name of your main view (&#8216;container&#8217; in this case).</p>
<p>Then instead of extending Controller, you would extend MY_Controller (or whatever you called it), and when you load the view you would have someting like this:</p>
<p>$this-&gt;load-&gt;view($this-&gt;container, $data);</p>
<p>This way you can change the main view easily, and you can even go further and create a small templating engine based on that principle.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: watanuki</title>
		<link>http://www.askaboutphp.com/48/codeigniter-organizing-views-simply.html/comment-page-1#comment-17570</link>
		<dc:creator>watanuki</dc:creator>
		<pubDate>Tue, 22 Dec 2009 13:39:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.askaboutphp.com/?p=48#comment-17570</guid>
		<description>thanks for the tips... quite useful.. ^^</description>
		<content:encoded><![CDATA[<p>thanks for the tips&#8230; quite useful.. ^^</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MEM</title>
		<link>http://www.askaboutphp.com/48/codeigniter-organizing-views-simply.html/comment-page-1#comment-13510</link>
		<dc:creator>MEM</dc:creator>
		<pubDate>Sat, 22 Aug 2009 11:56:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.askaboutphp.com/?p=48#comment-13510</guid>
		<description>Very nice post. I&#039;m not sure if the nested templates are the best method to use but, without any doubts, this is a very well explained post. Congrats!


Márcio</description>
		<content:encoded><![CDATA[<p>Very nice post. I&#8217;m not sure if the nested templates are the best method to use but, without any doubts, this is a very well explained post. Congrats!</p>
<p>Márcio</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cody</title>
		<link>http://www.askaboutphp.com/48/codeigniter-organizing-views-simply.html/comment-page-1#comment-12547</link>
		<dc:creator>Cody</dc:creator>
		<pubDate>Fri, 17 Jul 2009 04:04:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.askaboutphp.com/?p=48#comment-12547</guid>
		<description>I&#039;ve been using this method for awhile and I agree, it&#039;s much easier to maintain. It gets a little messy when some of the snippets are pulling from the database as well, but you can get around that using something like Wick. http://codeigniter.com/wiki/Wick/</description>
		<content:encoded><![CDATA[<p>I&#8217;ve been using this method for awhile and I agree, it&#8217;s much easier to maintain. It gets a little messy when some of the snippets are pulling from the database as well, but you can get around that using something like Wick. <a href="http://codeigniter.com/wiki/Wick/" rel="nofollow">http://codeigniter.com/wiki/Wick/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DCZ</title>
		<link>http://www.askaboutphp.com/48/codeigniter-organizing-views-simply.html/comment-page-1#comment-10552</link>
		<dc:creator>DCZ</dc:creator>
		<pubDate>Tue, 02 Jun 2009 14:29:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.askaboutphp.com/?p=48#comment-10552</guid>
		<description>Nice post , I&#039;m using the technique. Thx.</description>
		<content:encoded><![CDATA[<p>Nice post , I&#8217;m using the technique. Thx.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
