<?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>devexp &#187; Layout</title>
	<atom:link href="http://www.devexp.eu/tag/layout/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.devexp.eu</link>
	<description>DEVelopment EXPerience, shared with the world!</description>
	<lastBuildDate>Fri, 28 Oct 2011 12:07:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to use a symfony 1 layout from a different directory</title>
		<link>http://www.devexp.eu/2011/10/28/how-to-use-a-symfony-1-layout-from-a-different-directory/</link>
		<comments>http://www.devexp.eu/2011/10/28/how-to-use-a-symfony-1-layout-from-a-different-directory/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 11:48:36 +0000</pubDate>
		<dc:creator>Van de Voorde Toni</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Layout]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Symfony]]></category>

		<guid isPermaLink="false">http://www.devexp.eu/?p=1042</guid>
		<description><![CDATA[In symfony 1 it is possible to have different layouts for an application. But they all have to be put into the directory &#8216;myproject/apps/frontend/templates/&#8217;. But what if you want to use a layout from another location? Assume you make a &#8230; <a href="http://www.devexp.eu/2011/10/28/how-to-use-a-symfony-1-layout-from-a-different-directory/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a href="http://www.devexp.eu/wp-content/uploads/2009/04/symfony.jpg"><img src="http://www.devexp.eu/wp-content/uploads/2009/04/symfony.jpg" alt="" title="Symfony" width="127" height="35" class="alignright size-full wp-image-727" /></a>In symfony 1 it is possible to have different layouts for an application. But they all have to be put into the directory &#8216;myproject/apps/frontend/templates/&#8217;. But what if you want to use a layout from another location? </p>
<p>Assume you make a plugin with a specific layout, it would be nice to load the layout from the plugin directory, and not to have to copy the file to the global directory.</p>
<p>Here is how you can achieve this:</p>
<pre class="brush: php; title: ; notranslate">
$template = $this-&gt;getContext()-&gt;getConfiguration()-&gt;getTemplateDir('MODULE', 'LAYOUT_FILE.php');
$this-&gt;setLayout($template . '/LAYOUT_FILE');
</pre>
<p>Let&#8217;s say you have the following:</p>
<pre class="brush: plain; title: ; notranslate">
my_project/
  plugins/
    my_plugin/
      modules/
        MyUser/
          actions/
            actions.php
          templates/
            indexSuccess.php
            MyUserLayout.php
</pre>
<p>The actions.php class could be something like this:</p>
<pre class="brush: php; title: ; notranslate">
class MyUserAction extends sfActions {

  public function preExecute() {
    $template = $this-&gt;getContext()-&gt;getConfiguration()-&gt;getTemplateDir('MyUser', 'MyUserLayout.php');

    $this-&gt;setLayout($template . '/MyUserLayout');
  }

  public function executeIndex() {

  }
}
</pre>
<p>Have fun!</p>
<div class="shr-publisher-1042"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.devexp.eu/2011/10/28/how-to-use-a-symfony-1-layout-from-a-different-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>layout inspiration</title>
		<link>http://www.devexp.eu/2009/02/05/layout-inspiration/</link>
		<comments>http://www.devexp.eu/2009/02/05/layout-inspiration/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 12:00:29 +0000</pubDate>
		<dc:creator>van Rumste Kenneth</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[Layout]]></category>
		<category><![CDATA[design]]></category>

		<guid isPermaLink="false">http://www.devexp.eu/?p=363</guid>
		<description><![CDATA[A lot of programmers seem to hate the layout part of the job. Well if you work in a big company you probably won’t do the two jobs, but in some cases, or when you work in a small company &#8230; <a href="http://www.devexp.eu/2009/02/05/layout-inspiration/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p><img class="alignright size-full wp-image-364" title="design" src="http://www.devexp.eu/wp-content/uploads/2009/02/design.jpg" alt="design" width="200" height="132" />A lot of programmers seem to hate the layout part of the job. Well if you work in a big company you probably won’t do the two jobs, but in some cases, or when you work in a small company (ex 1-5 employees) you have to do them both (layout and programming). And for those guys, it isn’t always easy to have inspiration right away, well there is a solution.</p>
<p>Here are a few sites that have a huge portfolio with nice layout sites. You can grab the css in some cases, and that’s the interesting part of it.</p>
<p>Take a look at them.<br />
<a href="http://cssmania.com/" target="_blank">cssmania</a><br />
<a href="http://cssremix.com/" target="_blank">cssremix/</a><br />
<a href="http://www.cssimport.com/" target="_blank">cssimport</a><br />
<a href="http://www.designsnack.com/" target="_blank">designsnack</a><br />
Anyone got a better idea to get inspiration? Feel free to add your way of working in the comments.</p>
<div class="shr-publisher-363"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.devexp.eu/2009/02/05/layout-inspiration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>basic tips and tricks: 2. DIV vs. TABLE</title>
		<link>http://www.devexp.eu/2008/11/04/basic-tips-and-tricks-2-div-vs-table/</link>
		<comments>http://www.devexp.eu/2008/11/04/basic-tips-and-tricks-2-div-vs-table/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 12:42:51 +0000</pubDate>
		<dc:creator>van Rumste Kenneth</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[Layout]]></category>
		<category><![CDATA[table]]></category>
		<category><![CDATA[tag]]></category>

		<guid isPermaLink="false">http://www.devexp.eu/?p=238</guid>
		<description><![CDATA[A lot of people don&#8217;t really know when to use what kind of elements to build up an HTML page therefore I would like to take the time to explain tables and div elements. Tables are created to display data, &#8230; <a href="http://www.devexp.eu/2008/11/04/basic-tips-and-tricks-2-div-vs-table/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>A lot of people don&#8217;t really know when to use what kind of elements to build up an HTML page therefore I would like to take the time to explain tables and div elements.<br />
Tables are created to display data, they are built for it and that&#8217;s the only thing they are good for. To explain this we can take a look at the elements that a table can contain. Thead (again in tags &lt;thead&gt;&lt;/thead&gt;) contains the header row information of a table, tfoot contains the footer or bottom row of a table and tbody contains the body or data of a table. The easy thing about tables is that you can change them very easily without breaking out of the design, the height is fit automatically and data is displayed correctly the first time you show it. Off course with a little bit of CSS you get the layout just like you want it to. For more information on this you can take a look at my earlier post (<a href="../../../../../?p=50">http://www.devexp.eu/?p=50</a>)</p>
<p>Now what are div tags actually and why are they better to create a layout?</p>
<p>Div tags are nothing but logical divisions within the content of a page, they are built up with the &lt;div&gt; tag and make it easy to manage and style your HTML page just as you like. The cool thing about div tags is that you can name them individually, so you can affect them with CSS. As you can see the div will react a lot better with layout and give you all the possibilities you need.</p>
<p>The problem with tables is how unreadable and unusable they make your code. When you use a table as base to start from and create different rows and columns you will probably create other tables inside that table to display some content. And maybe you&#8217;ll end up with 3, 4 or even more tables within each other. When you have a page like that, please do take the time to look at the code and you&#8217;ll notice right away that it became very unreadable. When trying to change 1 column or 1 row you&#8217;ll see how complicated it gets. This method was very often used 3-4 years ago in web development but div tags are now getting the bigger hand in this now.</p>
<p>Let&#8217;s create a little example to illustrate this issue. This example will create data displayed like this:</p>
<div style="padding: 5px; background-color: #f1f1f1; width: auto;">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td colspan="2">This is a Title</td>
</tr>
<tr>
<td width="50%">aaa</td>
<td width="50%">bbb</td>
</tr>
<tr>
<td colspan="2">cccc</td>
</tr>
</tbody>
</table>
</div>
<pre class="brush: xml; title: ; notranslate">
&lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; width=&quot;100%&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;This is a Title&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width=&quot;50%&quot;&gt;aaa&lt;/td&gt;
&lt;td width=&quot;50%&quot;&gt;bbb&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;cccc&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
</pre>
<p>When we try to create this same view built up with div tags you will get:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div style=&quot;width: 100%;&quot;&gt;This is a Title&lt;/div&gt;
&lt;div style=&quot;width: 50%; float: left;&quot;&gt;aaa&lt;/div&gt;
&lt;div style=&quot;width: 50%; float: right;&quot;&gt;bbb&lt;/div&gt;
&lt;div style=&quot;width: 100%;&quot;&gt;ccc&lt;/div&gt;
</pre>
<p>I guess the example makes it pretty clear, you write less code and you are very flexible while using the div tags and it makes it very readable.</p>
<p>When creating pages, be sure to think about your design before starting and think of tables as data displayers, not as design tools. It will ask a lot of exercising when you&#8217;re not used to work with div tags, but after a while, you&#8217;ll see all their advantages. These tags and tables are built with a cause, tag for creating divisions in your page, tables for displaying data. Don&#8217;t mix them up.</p>
<div class="shr-publisher-238"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.devexp.eu/2008/11/04/basic-tips-and-tricks-2-div-vs-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

