<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Screenfony - Symfony Video tutorial</title>
	
	<link>http://www.screenfony.com</link>
	<description>Symfony Screencast</description>
	<lastBuildDate>Sun, 10 Mar 2013 18:13:34 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/screenfony/kByc" /><feedburner:info uri="screenfony/kbyc" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Symfony console tips to boost your productivity</title>
		<link>http://feedproxy.google.com/~r/screenfony/kByc/~3/f4xPJduqET8/symfony-console-tips</link>
		<comments>http://www.screenfony.com/blog/symfony-console-tips#comments</comments>
		<pubDate>Mon, 03 Dec 2012 10:30:45 +0000</pubDate>
		<dc:creator>ftassi</dc:creator>
				<category><![CDATA[Learning Symfony]]></category>

		<guid isPermaLink="false">http://www.screenfony.com/?p=629</guid>
		<description><![CDATA[Symfony ships with a great console component that allows you to run several useful tasks directly from CLI. Some of these commands are really popular and widely used by Symfony developers, while others are underused, even if they can really speed up your daily productivity. In this post I will see a bunch of them [...]]]></description>
				<content:encoded><![CDATA[<p>Symfony ships with a great console component that allows you to run several useful tasks directly from <abbr title="Command Line Interface">CLI</abbr>. Some of these commands are really popular and widely used by Symfony developers, while others are underused, even if they can really speed up your daily productivity. In this post I will see a bunch of them and I&#8217;ll talk about using them to improve your efficiency.</p>
<p>We all know how to clean the cache and how to install assets for a new bundle, we execute these command a billion time a month. Working with many different fellow Symfony developers I&#8217;m feeling that a lot of them are not taking full advantage of this wonderful tool, hence the need to share some tricks about this topic.</p>
<h2>One command to rule them all</h2>
<p>First al all, the king of all the tasks: <strong>help</strong>. This is really the only one you need to know, in order to master all the other commands and to discover how many useful things can a command do for you. It is surprising how many developers forget about the help command.</p>
<p>With the help command you can get a detailed explanation of any other command: arguments, options, usage examples. Use this command and it will really make your day. If you&#8217;re brave enough you can even stop reading now, you know enough to discover by yourself all I&#8217;m going to say to you. </p>
<p>Still here? Let&#8217;s move on then.</p>
<h2>Debug commands</h2>
<p>There are some commands that I usually use for debugging purpose:</p>
<ul>
<li>router:debug</li>
<li>router:match (from sf 2.1)</li>
<li>container:debug</li>
<li>doctrine:mapping:info &#038; doctrine:mongodb:mapping:info</li>
<li>doctrine:migrations:status</li>
</ul>
<p>router:debug and router:match are my favorites in this category. Every time I need to identify a controller from a route name or from a URL I use router:debug and router:match to get this information in about 0.1 seconds (quite fast, if you ask me). router:debug will list all the routes in the application or, if you pass a specific one as first argument, it will print out a lot of useful details for that route such as route class or, most important, the default parameters, which also contains the fully qualified name of the controller class. Cool, isn&#8217;t it ?</p>
<p>I also find very useful the *mapping:info commands, I usually use these tasks to check and debug my annotation syntax. I define or change an entity and then I run the info command to check my syntax. It is a good way to validate your annotations.</p>
<h2>Generator commands</h2>
<p>These are a bit less present in my daily workflow, but I think that they are worthy of a mention anyway. We have several generator commands:</p>
<ul>
<li>generate:bundle</li>
<li>generate:doctrine:crud</li>
<li>generate:doctrine:entities</li>
<li>generate:doctrine:entity</li>
<li>generate:doctrine:form</li>
</ul>
<p>Generate:bundle is, by far, the one I use the most here, I think that I&#8217;ve never implemented a bundle without this command. </p>
<p>Generating forms and cruds can save a lot of time, you should give these two commands a shot. Especially for the form classes it can be really useful to have an auto generated base to tweak and tune.</p>
<p>Again, help command is your best friend here, with it you can find all the available options you can use.</p>
<h2>External tools</h2>
<p>If you really love the cli as I do, there are at least two tools that you should take a look at:</p>
<ul>
<li><a href="http://knpbundles.com/servergrove/ServerGroveShellAliasBundle" title="ServerGroveShellAliasBundle" target="_blank">ServerGroveShellAliasBundle</a></li>
<li><a href="https://github.com/robbyrussell/oh-my-zsh" title="Oh My ZSH" target="_blank">Oh my zsh</a></li>
</ul>
<p>The first is not really an external tool, it is just a Symfony2 bundle, that will generate a list of shell aliases that you can use to speed up your typing. A good set of well known aliases can really make you faster, but many of us are lazy enough to not define a shell alias even if we type it 100 times per hour. This bundle will do it for you, I think it is worthy of a try.</p>
<p>&#8220;Oh my zsh&#8221; is, quoting the author, &#8220;A handful of functions, auto-complete helpers, and stuff that makes you shout…OH MY ZSHELL!&#8221;. I really love this project and I have been using this in the last year. It has a lot of <a href="https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins" title="Oh My ZSH plugins" target="_blank">plugins</a> that you can activate or deactivate, included an autocomplete plugin for Symfony2.</p>
<p>I think that&#8217;s all for now, I hope this will help you to be a little more productive in the future.</p>
<img src="http://feeds.feedburner.com/~r/screenfony/kByc/~4/f4xPJduqET8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.screenfony.com/blog/symfony-console-tips/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.screenfony.com/blog/symfony-console-tips</feedburner:origLink></item>
		<item>
		<title>Diving into security layer</title>
		<link>http://feedproxy.google.com/~r/screenfony/kByc/~3/jPSeEwxINxQ/symfony-custom-authentication-provider</link>
		<comments>http://www.screenfony.com/blog/symfony-custom-authentication-provider#comments</comments>
		<pubDate>Tue, 06 Nov 2012 10:00:58 +0000</pubDate>
		<dc:creator>ftassi</dc:creator>
				<category><![CDATA[Learning Symfony]]></category>
		<category><![CDATA[authentication provider]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[security system]]></category>

		<guid isPermaLink="false">http://www.screenfony.com/?p=547</guid>
		<description><![CDATA[Recently I had the opportunity to work a bit with the Symfony security component. Let me tell you something: it is amazing. Ok, I know, it may not be the most easy to understand implementation in the world, but it is really flexible and allows you to do almost everything. Once you get it, you&#8217;ll love it. [...]]]></description>
				<content:encoded><![CDATA[<p>Recently I had the opportunity to work a bit with the <strong>Symfony security component</strong>. Let me tell you something: it is <strong>amazing</strong>. Ok, I know, it may not be the most <em>easy to understand</em> implementation in the world, but it is really flexible and allows you to do almost everything. <em>Once you get it, you&#8217;ll love it</em>.</p>
<p>I had to implement an <strong>auto login mechanism</strong> to let users authenticate via a query string parameter and I want to<strong> share with you what I&#8217;ve learned</strong>.<span id="more-547"></span></p>
<p>First of all, let&#8217;s face it: having an auto login link is not the best way to preserve your user&#8217;s privacy, I know.</p>
<p><em>I would like to put aside any security concern (pretty weird for a post about security layer uh?), to concentrate just on the Symfony security component</em>.</p>
<p>I&#8217;m not even showing any code in this post, but <strong>the concept</strong> you&#8217;ll read here <strong>are valid for every custom authentication provider</strong> you&#8217;ll need.</p>
<p>Symfony security layer is based on two steps:</p>
<ul>
<li>Authentication</li>
<li>Authorization</li>
</ul>
<p>In this post we&#8217;re talking about <strong>authentication</strong>, and we&#8217;ll leave the authorization for another post.</p>
<h2>The components</h2>
<p>Authorization is quite simple, once you have the big picture in mind and you get used to the terminology. <strong>Three main actors are involved</strong> in the authentication process:</p>
<ul>
<li>A <strong>Token</strong></li>
<li>A <strong>Listener</strong></li>
<li>An <strong>Authentication Provider</strong></li>
</ul>
<h3>The Token</h3>
<p>The token is probably the most confusing piece, but its role is fundamental and afterall its job is quite simple. Think of the token as a simple container: <strong>the token retains the user&#8217;s credentials</strong> present in the request and, after the authentication, <strong>the authenticated user itself</strong>.</p>
<p><em>The security system uses the token to move these information through the involved components.</em></p>
<h3>The listener</h3>
<p>The listener is the glue between the request and the authentication provider.</p>
<p>Its job is to<strong> retrieve the user&#8217;s authentication parameters</strong> (usually from the request), create a token and try to authenticate it through the authentication manager (which will delegate the authentication process to a set of compatible authentication providers). If the authentication manager returns an authenticated token, <strong>the listener stores it in the security context</strong>.</p>
<h3>The authentication provider</h3>
<p>The authentication provider is the real boss here. It <strong>verifies the user&#8217;s authentication information</strong> stored in the token and returns an <strong>authenticated token</strong> which contains the authenticated user.</p>
<p>As you can have many different tokens and many different authentication providers, authentication manager must know which provider is capable of handling a particular token. Here comes to play the AuthenticationProviderInterface which contains an <em>authenticate</em> and a <em>support</em> method. The <em>support</em> method will belp the authentication provider to decide which provider is able to authenticate a particular token.</p>
<h2>The big picture</h2>
<p>How does these three objects work together and how can the security system know anything about these?</p>
<p>You read in the documentation (you read the doc, right?) that security is a two steps process: authentication and authorization. Authentication is managed by a <strong>Firewall</strong>. When the firewall is activated, it <strong>calls the listeners</strong> (we talked about them above): any of the configured listeners could be able to authenticate a user.</p>
<p><em>Unfortunately tying firewall and listeners together is not so easy, because you can have different firewalls to secure different parts of your application, depending on your configuration</em>.</p>
<p>To solve this you need to implement a <strong>special factory class</strong>, that implements SecurityFactoryInterface that will <strong>create the needed DIC entries</strong>.</p>
<p>This is pretty much all you need to know to implement your custom authentication provider.</p>
<h2><strong>Auto login</strong></h2>
<p>I haven&#8217;t written anything about my implementation of the auto login feature. The reaons is the implementation has nothing magic in it, it&#8217;s quite simple and it doesn&#8217;t add so much value to the explanation.</p>
<p>If you&#8217;re looking for code, there is a <strong>great cookbook</strong> about <a title="Custom authentication provider with symfony2" href="http://symfony.com/doc/current/cookbook/security/custom_authentication_provider.html" target="_blank">how to implement a custom authentication provider</a>. You can use that as a good starting point for your implementation. While learning how all these classes work together, I found very helpful to <strong>look at the code</strong> and in particular at the <strong>RememberMeListener</strong>.</p>
<p>That said, if you&#8217;d like to read about my implementation, I can share it in another post about this topic, or maybe plan a <a title="Implement different authentication method with Symfony2" href="http://screenfony.uservoice.com/forums/136445-general/suggestions/2361086-different-login-options" target="_blank">screencast about it</a>.</p>
<img src="http://feeds.feedburner.com/~r/screenfony/kByc/~4/jPSeEwxINxQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.screenfony.com/blog/symfony-custom-authentication-provider/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.screenfony.com/blog/symfony-custom-authentication-provider</feedburner:origLink></item>
		<item>
		<title>Building a REST server with Symfony</title>
		<link>http://feedproxy.google.com/~r/screenfony/kByc/~3/6sOuG-6Ho9w/symfony-2-rest</link>
		<comments>http://www.screenfony.com/blog/symfony-2-rest#comments</comments>
		<pubDate>Wed, 31 Oct 2012 10:00:49 +0000</pubDate>
		<dc:creator>ftassi</dc:creator>
				<category><![CDATA[Screenfony]]></category>
		<category><![CDATA[FOS]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[screencast]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.screenfony.com/?p=605</guid>
		<description><![CDATA[You can use Symfony2 to build pretty much any kind of web application and web service. Speaking of web services, REST is certainly one of the most popular architecture in these days, and the community provided some good solutions (FOSRestBundle)to implement your API. Our next screencast will cover this topic and we thought to share [...]]]></description>
				<content:encoded><![CDATA[<p>You can use <strong>Symfony2</strong> to build pretty much any kind of web application and <strong>web service</strong>. Speaking of web services, <strong>REST</strong> is certainly one of the most <strong>popular architecture</strong> in these days, and the community provided some good solutions (<strong>FOSRestBundle</strong>)to implement your API. <em>Our next screencast will cover this topic and we thought to share same ideas about it.</em></p>
<p><span id="more-605"></span></p>
<p>So you need to implement an API, maybe you want to be able to interact with some mobile application or just let some third party application to do cool stuff with your data. You&#8217;ve already read about all different architectures and REST is your final choice.</p>
<p>If you are reading this post, chances are that you want to implement your REST server using Symfony2 (or at least PHP). If so, our screencast will point you in the right direction (hopefully).</p>
<p>The main point of building a REST server with Symfony2 is FOSRestBundle. This bundle will take care of most of the boring staff for you, and will help you implementing a REST web service in the right way. Though it doesn&#8217;t all the work for you, it is certainly a good starting point that you should take in consideration.</p>
<p><em>We will guide you through the usage of this bundle implementing a complete CRUD for a resource.</em></p>
<p>Implementing an API also mean testing it, be able to debug it and provide good documentation for your clients. <em>In our tutorial we will show you a handful of tools to effectively perform these tasks as well.</em></p>
<p>This screencast is still a work in progress, you&#8217;re in time to discuss with us what you&#8217;d like to see in it.</p>
<p>Any fancy ideas ? <a title="Screencast idea: REST with symfony " href="http://screenfony.uservoice.com/forums/136445-general/suggestions/3299456-rest-web-service" target="_blank">we&#8217;re open for suggestion</a>.</p>
<img src="http://feeds.feedburner.com/~r/screenfony/kByc/~4/6sOuG-6Ho9w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.screenfony.com/blog/symfony-2-rest/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.screenfony.com/blog/symfony-2-rest</feedburner:origLink></item>
		<item>
		<title>Storing your files elsewhere…</title>
		<link>http://feedproxy.google.com/~r/screenfony/kByc/~3/Sb1ZfoHsiIQ/gaufrette-filesystem-abstraction</link>
		<comments>http://www.screenfony.com/blog/gaufrette-filesystem-abstraction#comments</comments>
		<pubDate>Tue, 23 Oct 2012 10:30:59 +0000</pubDate>
		<dc:creator>ftassi</dc:creator>
				<category><![CDATA[Symfony Ecosystem]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[gaufrette]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://www.screenfony.com/?p=518</guid>
		<description><![CDATA[So, you&#8217;re working on this brand new, exciting, Symfony2 project that needs to store files somewhere. As you, like any good developer, enjoy simple solutions, you just store these files on filesystem. Fair enough, until the day when your boss comes to you talking about S3 and its great performance. That&#8217;s the moment when you [...]]]></description>
				<content:encoded><![CDATA[<p>So, you&#8217;re working on this brand new, exciting, Symfony2 project that needs to store files somewhere. As you, like any good developer, enjoy simple solutions, you just store these files on filesystem. Fair enough, until the day when your boss comes to you talking about S3 and its great performance. That&#8217;s the moment when you realize that you&#8217;re screwed (We all have been there).</p>
<p>Here it comes gaufrette: a<strong> filesystem abstraction library that allows you to store your medias everywhere</strong> you need to, <strong>using a unified API</strong>.</p>
<p><span id="more-518"></span></p>
<p>As we all know, web applications are growing creatures and requirements are far from defined when you start a new project. Our job, as developers, is to be able to quickly and efficiently respond to changes. One of the best choice that you can do about filesystem storage is <strong>gaufrette</strong>.</p>
<p>Gaufrette offers a <strong>simple object-oriented API to abstract both filesystems and files</strong>. This means that you get the <strong>same interface</strong>, no matter if your filesystem is <strong>local</strong>, on <strong>Amazon S3</strong>, or anywhere else. With gaufrette you&#8217;re storing your files somewhere, the library takes care of the rest.</p>
<p><em>This is really crucial, because at the beginning of a project you don&#8217;t want to think about &#8220;where&#8221;: as you&#8217;re already busy building business logic of your application, you just want to store files. But at some point you may want to switch from your local filesystem to some kind of cloud. With Gaufrette this switch is just a matter of configurations, whereas without it you&#8217;d have to surf around your application code hoping to find all the places you save and reference files.</em></p>
<p>With <strong>Gaufrette you can be completely storage agnostic</strong>. Sounds great uh?</p>
<p>All the magic is done by adapters. Your application interacts with Gaufrette, Gaufrette interacts with any filesystem through an adapter. <strong>Swap an adapter with another and you&#8217;ll end up saving files to a remote cloud instead of the local filesystem</strong>. The library ships with a rich set of ready to use adapters such as (this is not a complete list):</p>
<ul>
<li>AmazonS3</li>
<li>RackspaceCloudFiles</li>
<li>Ftp</li>
<li>Dropbox</li>
</ul>
<p>and more. And if you need to work with some exotic filesystem, you can always write your own adapter implementing the Adapter interface.</p>
<p>Gaufrette is a library by KnpLabs, if you want to know everything about this great piece of code you can read a <a title="Give your projects a Gaufrette" href="http://knplabs.com/blog/give-your-projects-a-gaufrette">post about it</a> from their blog or the documentation at the <a title="KnpLabs/Gaufrette" href="https://github.com/KnpLabs/Gaufrette">github repository</a>.</p>
<p>If you want to learn more about <strong>how to <a title="How to upload with Symfony2" href="http://tutorial.screenfony.com/product/premium/symfony-file-upload" target="_blank">upload a file with Symfony</a></strong> you can check out our <a title="how to upload a file with Symfony" href="http://tutorial.screenfony.com/product/premium/symfony-file-upload">screencast</a> that will introduce you to the <strong>main concepts</strong> <strong>of file upload handling</strong> and to VichUploaderBundle which also offers a way to to <a title="Upload with VichUploaderBundle and gaufrette" href="https://github.com/dustin10/VichUploaderBundle/blob/master/Resources/doc/index.md#filesystemstorage-vs-gaufrettestorage">handle uploads with Gaufrette</a>.</p>
<p>Stay tuned, in the next post I&#8217;ll show some example of how this library works.</p>
<img src="http://feeds.feedburner.com/~r/screenfony/kByc/~4/Sb1ZfoHsiIQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.screenfony.com/blog/gaufrette-filesystem-abstraction/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.screenfony.com/blog/gaufrette-filesystem-abstraction</feedburner:origLink></item>
		<item>
		<title>Find the right bundle</title>
		<link>http://feedproxy.google.com/~r/screenfony/kByc/~3/C8BMt74txYs/find-symfony2-bundles</link>
		<comments>http://www.screenfony.com/blog/find-symfony2-bundles#comments</comments>
		<pubDate>Mon, 08 Oct 2012 13:26:57 +0000</pubDate>
		<dc:creator>ftassi</dc:creator>
				<category><![CDATA[Bundles]]></category>
		<category><![CDATA[community]]></category>

		<guid isPermaLink="false">http://www.screenfony.com/?p=503</guid>
		<description><![CDATA[Symfony allows developer to expand its functionalities with bundles. As a matter of fact, every single functionality of the framework comes from a bundle, and more are available from the community. You can really find a bundle that solves pretty much every common need that your application may have, but how can you search the [...]]]></description>
				<content:encoded><![CDATA[<p>Symfony allows developer to expand its functionalities with bundles. As a matter of fact, every single functionality of the framework comes from a bundle, and more are available from the community. You can really find a bundle that solves pretty much every common need that your application may have, but how can you search the best bundle for your needs? The best answer we can give you is <strong>&#8220;KnpBundles&#8221;</strong>. Let&#8217;s have a look at this incredible resource.</p>
<p><span id="more-503"></span></p>
<p>I thought that every single Symfony developers knows about knpbundle, but working experiences with different teams show me that this is not always the truth, and that&#8217;s why I&#8217;m writing this post: to spread the voice.</p>
<p>As said every single Symfony functionality comes from a bundle. The Standard Edition comes with a <a title="Symfony standard edition bundles" href="http://symfony.com/doc/current/bundles/index.html" target="_blank">few pre-installed bundles</a>, so this may not be obvious to new users. As a bonus from the decoupled architecture of the framework, every new functionality that you need to implement can be (and should be) a bundle. Thanks to this level of expandability the Symfony developers community is generating a lot of bundles.</p>
<p>Find the <strong>right bundle for the right job could be a pain</strong>, and here comes <a title="Symfony bundles repository" href="http://knpbundles.com/" target="_blank">knpbundles.com</a></p>
<p>The website let you search over a catalog of about 1600 bundles (and counting) from the community, but it also has a score algorithm that tries to help you choosing the best one for your needs. Chances are that the higher the score, the better the bundle.</p>
<p>Knpbundles integrates with github and calculates the score against a number of factors such as:</p>
<ul>
<li>Github followers</li>
<li>length of README file</li>
<li>Travis result</li>
<li>composer package definition</li>
</ul>
<p>and <a title="Knpbundles score explanation" href="http://knpbundles.com/about/scoring" target="_blank">much more</a>. When you find different bundles for the same task, you&#8217;ll usually want to get the one with the higher score.<br />
You can also have a look at the evolution of the bundle, at its developers, at its number of recommendations.</p>
<p>If you are looking for a bundle, Knpbundles is the way to go.<br />
If you are a bundle developer don&#8217;t forget to <a title="Register a new bundle " href="http://knpbundles.com/add" target="_blank">register your own bundle</a> so it can be found by the rest of the world.</p>
<img src="http://feeds.feedburner.com/~r/screenfony/kByc/~4/C8BMt74txYs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.screenfony.com/blog/find-symfony2-bundles/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.screenfony.com/blog/find-symfony2-bundles</feedburner:origLink></item>
		<item>
		<title>Work with bootstrap, assetic and less</title>
		<link>http://feedproxy.google.com/~r/screenfony/kByc/~3/lVBW1uJHO3M/howto-symfony-bootstrap-assetic-less</link>
		<comments>http://www.screenfony.com/blog/howto-symfony-bootstrap-assetic-less#comments</comments>
		<pubDate>Sat, 15 Sep 2012 06:25:58 +0000</pubDate>
		<dc:creator>ftassi</dc:creator>
				<category><![CDATA[Symfony2 Tutorial]]></category>
		<category><![CDATA[bootstrap]]></category>
		<category><![CDATA[composer]]></category>
		<category><![CDATA[cookbook]]></category>
		<category><![CDATA[less]]></category>
		<category><![CDATA[lessphp]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://www.screenfony.com/?p=459</guid>
		<description><![CDATA[Bootstrap is a well known and powerful front-end framework for fast prototyping, it uses LESS and it can be easily integrate in your Symfony applications with the help of assetic. In this tutorial I&#8217;ll show how to: Install bootstrap in you Symfony application Load it using assetic Compile bootstrap LESS files with lessphp Let&#8217;s start with [...]]]></description>
				<content:encoded><![CDATA[<p><strong><a title="Twitter Bootstrap" href="http://twitter.github.com/bootstrap/" target="_blank">Bootstrap</a></strong> is a well known and powerful front-end framework for fast prototyping, it uses <a title="LESS The dynamic stylesheet language" href="http://lesscss.org/" target="_blank">LESS</a> and it <strong>can be easily integrate in your Symfony applications with the help of assetic</strong>. In this tutorial I&#8217;ll show how to:</p>
<ul>
<li>Install bootstrap in you Symfony application</li>
<li>Load it using assetic</li>
<li>Compile bootstrap LESS files with lessphp</li>
</ul>
<p><span id="more-459"></span></p>
<p>Let&#8217;s start with a <strong>fresh Symfony2.1 application</strong>, the best way to create a new application is <strong>using composer</strong>:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">composer create-project symfony<span style="color: #000000; font-weight: bold;">/</span>framework-standard-edition bootstrapdemo <span style="color: #000000;">2.1</span>.x-dev</pre></td></tr></table></div>

<p>After that, we need to install bootstrap within our application, again we will use composer to download and install the source code. <strong>Bootstrap doesn&#8217;t have a composer package so we&#8217;ll need a little bit of extra work to get it done</strong>.</p>
<p>Add the repository definition to your composer.json:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="json" style="font-family:monospace;">&quot;repositories&quot;: [
        {
            &quot;type&quot;: &quot;package&quot;,
            &quot;package&quot;: {
                &quot;name&quot;: &quot;twitter/bootstrap&quot;,
                &quot;version&quot;: &quot;2.1.0&quot;,
                &quot;source&quot;: {
                    &quot;type&quot;: &quot;git&quot;,
                    &quot;url&quot;: &quot;https://github.com/twitter/bootstrap&quot;,
                    &quot;reference&quot;: &quot;v2.1.0&quot;
                }
            }
        }
    ]</pre></td></tr></table></div>

<p>and then, add bootstrap as a dependency as usual:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="json" style="font-family:monospace;">&quot;twitter/bootstrap&quot;: &quot;v2.1.0&quot;</pre></td></tr></table></div>

<blockquote><p>Note:<br />
Mind that we are not installing the latest bootstrap version, but 2.1.0 because of a known issue with lessphp. By the time you read, this could be solved, you should try using &#8220;master&#8221; instead of &#8220;2.1.0&#8243; and see how it goes</p></blockquote>
<p>Last but not least, <strong>we need lessphp in order to be able to compile our boostrap .less files</strong>, let&#8217;s add to our composer.json:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="json" style="font-family:monospace;">&quot;leafo/lessphp&quot;: &quot;dev-master&quot;</pre></td></tr></table></div>

<p>Now we can run:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">composer update twitter<span style="color: #000000; font-weight: bold;">/</span>bootstrap leafo<span style="color: #000000; font-weight: bold;">/</span>lessphp</pre></td></tr></table></div>

<p>This will download needed sources. Fair enough, it&#8217;s time to <strong>start writing some Symfony code</strong>, isn&#8217;t it?</p>
<p>Assets management with assetic is well documented in <a title="How to use Assetic for assets management" href="http://symfony.com/doc/current/cookbook/assetic/asset_management.html" target="_blank">this cookbook</a>, if you are completely new to it I&#8217;ll suggest to start from there.</p>
<p>Assetic ships whit a lot of useful filters, we&#8217;ll use <strong>LessphpFilter</strong>, so we need to configure it (some filters require configuration params, some don&#8217;t) in config.yml, find assetic section and add:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="yaml" style="font-family:monospace;"><span style="color: #007F45;">filters</span>:<span style="color: #007F45;">
        lessphp</span>:<span style="color: green;">
            file</span><span style="font-weight: bold; color: brown;">: </span><span style="font-weight: bold; color: red;">%kernel.root_dir%/../vendor/leafo/lessphp/lessc.inc.php</span><span style="color: green;">
            apply_to</span><span style="font-weight: bold; color: brown;">: </span><span style="color: #CF00CF;">&quot;\.less$&quot;</span></pre></td></tr></table></div>

<p>This will define lessphp path, and will apply the filter to all our .less files. This filter is mandatory for less files, so I usually apply it to all .less files by default. After that, the last thing we need is to include bootstrap in main template:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="smarty" style="font-family:monospace;"><span style="color: #D36900;">&#123;</span><span style="color: #D36900;">%</span> stylesheets <span style="color: #ff0000;">'%kernel.root_dir%/../vendor/twitter/bootstrap/less/bootstrap.less'</span> <span style="color: #D36900;">%</span><span style="color: #D36900;">&#125;</span>
&nbsp;
<span style="color: #D36900;">&#123;</span><span style="color: #D36900;">%</span> endstylesheets <span style="color: #D36900;">%</span><span style="color: #D36900;">&#125;</span></pre></td></tr></table></div>

<p>Nothing special here, <strong>just mind that we are using absolute path for boostrap file</strong>, this allows us to work with vendor files, and that <strong>we are not specifying lessphp filter</strong> since it will be applied by default for .less files.</p>
<p>And that&#8217;s all.</p>
<p><strong><a title="Manage assets with assetic" href="https://github.com/kriswallsmith/assetic" target="_blank">Assetic</a> is a really powerful</strong> tool and it can really improve the way you <strong>manage and optimize</strong> your assets, we are planning to release a <strong>premium screencast</strong> about <strong>advanced assetic usage with twig</strong>, if you think you&#8217;ll love it give us some feedback and let us know what you should see in it.</p>
<p>Happy coding.</p>
<img src="http://feeds.feedburner.com/~r/screenfony/kByc/~4/lVBW1uJHO3M" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.screenfony.com/blog/howto-symfony-bootstrap-assetic-less/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		<feedburner:origLink>http://www.screenfony.com/blog/howto-symfony-bootstrap-assetic-less</feedburner:origLink></item>
		<item>
		<title>Manage users in symfony2</title>
		<link>http://feedproxy.google.com/~r/screenfony/kByc/~3/TS7ku3gglHw/manage-users-in-symfony2</link>
		<comments>http://www.screenfony.com/blog/manage-users-in-symfony2#comments</comments>
		<pubDate>Wed, 09 May 2012 10:00:59 +0000</pubDate>
		<dc:creator>ftassi</dc:creator>
				<category><![CDATA[Bundles]]></category>
		<category><![CDATA[For]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[users]]></category>

		<guid isPermaLink="false">http://www.screenfony.com/?p=421</guid>
		<description><![CDATA[Managing users is a very common task in any web application. As a Symfony developer you want to focus on your application business logic and not on writing boring stuff like user registrations, reset password procedures and so on. Not need to mention our Drupal and WordPress friends, they will piss out of you working [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.screenfony.com/wp-content/uploads/2012/05/4866958826_4de27448861.jpg"><img class="size-full wp-image-447 alignright" title="4866958826_4de2744886" src="http://www.screenfony.com/wp-content/uploads/2012/05/4866958826_4de27448861.jpg" alt="" width="320" height="213" /></a><a href="http://www.screenfony.com/wp-content/uploads/2012/05/4866958826_4de2744886.jpg"><br />
</a>Managing users is a very common task in any web application. As a Symfony developer you want to <strong>focus on your application</strong> business logic <strong>and not on writing boring stuff</strong> like user registrations, reset password procedures and so on. Not need to mention our Drupal and WordPress friends, they will piss out of you working for 2 days just for a standard registration flow. We don&#8217;t want to be mocked from anyone. Here comes<strong> FOSUserBundle</strong> from <em>FriendsOfSymfony</em>. <strong>With few steps and a minimal configuration you will be able to handle users in your Symfony application</strong>. It is so flexible that you can use it as your base for any of your applications. Let&#8217;s have a look at it.</p>
<p><span id="more-421"></span></p>
<p>You should know now what a bundle is. If you don&#8217;t, have a look at the <a title="Symfony Bundle system" href="http://symfony.com/doc/current/book/page_creation.html#page-creation-bundles" target="_blank">official documentation</a>.</p>
<p>We love bundles and you should too! Bundles are the way to share code with other developers and through different applications. Our motto is <em>&#8220;more bundles for everyone&#8221;</em>. Every single day, in your developer life, you are going to start a new feature, check for a bundle that cover it, and this world will be a better place <img src='http://www.screenfony.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>FOSUserBundle</strong> is the bundle for you if your application need to have <strong>some user management stuff</strong> such as registration flows, confirmation emails, reset password procedures. More or less all the common needs of a standard web app are satisfied.<br />
As many other bundles from FriendsOfSymfony, <strong>FOSUserBundle has a great code base</strong>, which is really flexible and reliable at the same time. <strong>It works well with doctrine, propel, mongo and couchdb and the entire bundle if unit tested</strong>.</p>
<p>If you need to,<strong> you will be able to customize</strong> its core functionalities extending its templates, controllers or the services it defines. <strong>FOSUserBundle</strong> has a <strong>very thorough documentation</strong> that will guide you over your customization process. You can also <strong>make it work with other authentication mechanisms</strong>. If you want to know <strong><a title="How to integrate fosuserbundle and fosfacebookbundle" href="http://tutorial.screenfony.com/product/premium/howto-integrate-fosuserbundle-fosfacebookbundle">how to integrate FOSFacebookBundle and FOSUserBundle</a></strong> we have recorded a screencast for you!</p>
<p>We can&#8217;t cover all the functionality of the bundle here (it would take several posts for it) but <strong>we want to warmly recommend to use this bundle</strong> in your next application. If you are looking for <em>best practices</em> and <em>good habits</em>, <strong>you should really use FOSUserBundle for managing users</strong>.</p>
<p>What do you think about it? Did you know this bundle? Are you using it or are you planning to do in the future? Would you like a premium detailed screencast about its functionalities? Let us know using our <a title="Give us feedback" href="http://screenfony.uservoice.com/">uservoice page</a>!</p>
<img src="http://feeds.feedburner.com/~r/screenfony/kByc/~4/TS7ku3gglHw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.screenfony.com/blog/manage-users-in-symfony2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.screenfony.com/blog/manage-users-in-symfony2</feedburner:origLink></item>
		<item>
		<title>A handful of quick symfony tutorial from the Cookbook</title>
		<link>http://feedproxy.google.com/~r/screenfony/kByc/~3/kMMEUBOSf9Y/quick-symfony-tutorial</link>
		<comments>http://www.screenfony.com/blog/quick-symfony-tutorial#comments</comments>
		<pubDate>Wed, 04 Apr 2012 12:00:15 +0000</pubDate>
		<dc:creator>ftassi</dc:creator>
				<category><![CDATA[Community Edition]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[cookbook]]></category>

		<guid isPermaLink="false">http://www.screenfony.com/?p=197</guid>
		<description><![CDATA[If you have written even the smallest Symfony2 app, you surely have perused the Symfony2 official documentation. If you haven&#8217;t had the chance of glancing over the cookbook, you should check it out now: it&#8217;s a collection of useful recipes and quick tutorials to solve common problems, written in a practical and direct way. At [...]]]></description>
				<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-327" title="cookbook1" src="http://www.screenfony.com/wp-content/uploads/2011/11/cookbook1.png" alt="Enjoy our free symfony tutorial" width="592" height="236" /></p>
<p>If you have written even the smallest Symfony2 app, you surely have perused the <a title="Symfony current doc" href="http://symfony.com/doc/current/">Symfony2 official documentation</a>.</p>
<p>If you haven&#8217;t had the chance of glancing over the <strong><a title="Symfony cookbook" href="http://symfony.com/doc/current/cookbook/index.html">cookbook</a></strong>, you should <strong>check it out now</strong>: it&#8217;s a collection of useful recipes and <strong>quick tutorials</strong> to solve common problems, written in a practical and direct way.</p>
<p>At Screenfony we believe <strong>screencasts are a quick way</strong> to see things in action. So -we thought- <strong>why not give these recipes a little &#8220;video&#8221; twist!?</strong></p>
<p><span id="more-197"></span></p>
<p>That&#8217;s it! <strong>We are planning to support the official Symfony2 cookbook</strong> producing an alternate way of getting the point of each recipe. Often times seeing it in action is better than reading it!</p>
<p>If you are the kind of person who prefers PDF&#8217;s this won&#8217;t be a shocking news, but we believe that if you are following this blog you will probably like it!</p>
<p>As we record the video recipes we <strong>will try to add some &#8220;Screenfony juice&#8221;</strong>: sometimes we might add <strong>our point of view</strong> on the topic, sometimes we might <strong>make some obscure points more clear</strong>, sometimes we could end up creating a <strong>completely new recipe</strong>!</p>
<p>Each video recipe will be a <a title="free Symfony2 tutorial" href="http://www.screenfony.com/blog/free-symfony-video-tutorial">free Symfony2 tutorial</a> available on our <a title="Screenfony Youtube Channel" href="http://www.youtube.com/screenfony" rel="nofollow">YouTube channel</a>. It&#8217;s probably premature now, but it would be nice if they could be linked directly from the documentation.</p>
<p><strong>If you like</strong> the whole idea of <strong>video recipes</strong>, <strong><a href="http://screenfony.uservoice.com/">let us know which are your favourite</a></strong>: we will happily give priority to the most requested!</p>
<p>Check the <strong>first two recipes</strong> on our <a title="Screenfony Youtube Channel" href="http://www.youtube.com/screenfony">YouTube channel</a>, the <strong>&#8220;community edition&#8221;</strong> series has begun!</p>
<p>Keep following our blog and <a href="http://www.screenfony.com/subscribe">subscribe to our mailing list</a> to know the latest news on our project!</p>
<p>Stay tuned!</p>
<img src="http://feeds.feedburner.com/~r/screenfony/kByc/~4/kMMEUBOSf9Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.screenfony.com/blog/quick-symfony-tutorial/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.screenfony.com/blog/quick-symfony-tutorial</feedburner:origLink></item>
		<item>
		<title>Screencast community edition</title>
		<link>http://feedproxy.google.com/~r/screenfony/kByc/~3/zwO8kMwDxZM/free-symfony-video-tutorial</link>
		<comments>http://www.screenfony.com/blog/free-symfony-video-tutorial#comments</comments>
		<pubDate>Wed, 09 Nov 2011 13:31:28 +0000</pubDate>
		<dc:creator>ftassi</dc:creator>
				<category><![CDATA[Community Edition]]></category>
		<category><![CDATA[community]]></category>

		<guid isPermaLink="false">http://www.screenfony.com/?p=198</guid>
		<description><![CDATA[Communities are the hearth of every open source, symfony makes no exception. With Screenfony we are trying to make a living out of video tutorials for Symfony2, but we feel the importance of contributing back to the community. For this reason we setup the official Screenfony YouTube channel where you&#8217;ll find all our community edition [...]]]></description>
				<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-full wp-image-199 aligncenter" title="cc" src="http://www.screenfony.com/wp-content/uploads/2011/11/cc.jpg" alt="Creative Commons" width="580" height="338" /></p>
<p>Communities are the hearth of every open source, symfony makes no exception. With Screenfony we are trying to make a living out of video tutorials for Symfony2, but we feel the importance of contributing back to the community.</p>
<p><span id="more-198"></span></p>
<p>For this reason we setup the official <a title="Screenfony Youtube channel" href="http://www.youtube.com/user/screenfony">Screenfony YouTube channel</a> where you&#8217;ll find all our <strong>community edition</strong> <a href="http://www.youtube.com/user/screenfony" title="free Symfony video tutorial" >Symfony video tutorials</a>, which will be published for free.</p>
<p>We&#8217;ll talk more about the single videos as we release them, we don&#8217;t want to spoil the fun.<br />
As usual we appreciate <a href="http://screenfony.uservoice.com">your suggestions and advices</a>.</p>
<p>Our Youtube channel will collect the best tutorials, screencasts and presentation videos around the web: if you find something interesting around, let us know and we&#8217;ll add it to our playlists!</p>
<p>See you soon!</p>
<img src="http://feeds.feedburner.com/~r/screenfony/kByc/~4/zwO8kMwDxZM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.screenfony.com/blog/free-symfony-video-tutorial/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.screenfony.com/blog/free-symfony-video-tutorial</feedburner:origLink></item>
		<item>
		<title>Deploy Symfony application with capifony</title>
		<link>http://feedproxy.google.com/~r/screenfony/kByc/~3/SVMSJAdkeEE/deploy-symfony-application-with-capifony</link>
		<comments>http://www.screenfony.com/blog/deploy-symfony-application-with-capifony#comments</comments>
		<pubDate>Mon, 03 Oct 2011 10:00:37 +0000</pubDate>
		<dc:creator>ftassi</dc:creator>
				<category><![CDATA[Symfony Ecosystem]]></category>
		<category><![CDATA[capifony]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[screencast]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://www.screenfony.com/?p=178</guid>
		<description><![CDATA[Capifony is a deployment recipes collection for capistrano that works with both symfony and symfony2 applications. Capifony lets you deploy your symfony applications very very easily. Around the web you can find many good posts about deploying symfony application with capifony. Screenfony is about screencasts so that&#8217;s what we aim to share in this blog. [...]]]></description>
				<content:encoded><![CDATA[<p>Capifony is a deployment recipes collection for capistrano that works with both symfony and symfony2 applications. Capifony lets you deploy your symfony applications very very easily.</p>
<p>Around the web you can find many good posts about <a title="Deploy Symfony application with capifony" href="http://moidev.com/2011/09/desplegando-proyectos-symfony2-con-capistrano-capifony-y-git-screencast/" target="_blank">deploying symfony application with capifony</a>. Screenfony is about screencasts so that&#8217;s what we aim to share in this blog.<br />
Our first screencast mention is for Moises Gallego and his <a title="Desplegando proyectos Symfony2 con Capistrano-Capifony y Git" href="http://moidev.com/2011/09/desplegando-proyectos-symfony2-con-capistrano-capifony-y-git-screencast/" target="_blank">good video introduction to capifony</a>. He shared it with us and we want to share it with you. In his post you will also find a <a title="Desplegando proyectos Symfony2 con Capistrano-Capifony y Git" href="http://www.slideshare.net/moisesgallego/desplegando-proyectos-symfony2-con-capistranocapifony-y-git" target="_blank">slidshare presentation</a>.<br />
Both the screencast and the presentation are in Spanish. Would you like to have them in English? Let us know in the comments!</p>
<p>At Screenfony we follow the community efforts to spread knowledge about Symfony and related stuff, for this reason we want to use this blog also to collect useful resources on the net. If you have created a screencast (or a post or a slideshare presentation) about symfony <a title="Submit your screencast now" href="http://www.screenfony.com/contact-us">share it with us</a>, we will promote your content on this blog.</p>
<img src="http://feeds.feedburner.com/~r/screenfony/kByc/~4/SVMSJAdkeEE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.screenfony.com/blog/deploy-symfony-application-with-capifony/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.screenfony.com/blog/deploy-symfony-application-with-capifony</feedburner:origLink></item>
	</channel>
</rss>
