Tag Archives: framework
How to access symfony2 console?
Hi All
The most awesome feature symfony framework provides is CLI interface. Symfony2 is also packed with same cool CLI.
Just put symfony2 sandbox to your root directory (i tried with ubuntu setup). Point to your sf2 project dir and type “php symfony app/console” and hit enter.
It should show you all the commands available for Continue reading
Symfony Exceptions
In case of error or unauthorized access to, for example, it makes sense to throw an exception. In order to react to the error conditions better, should throw it back on the correct type of the exception and not always … Continue reading
symfony form field without a label
I was standing in front of the problem that I have a form with only one field. In this case the label of the field has shown no sense. For this reason, it had gone – but how? The solution … Continue reading
Symfony2 WebProfiler
Symfony2 just introduced its WebProfiler, the utility will soon be the favorite of all programmers. Most veterans will recall that five years ago was the first Symfony framework to include a web debug toolbar. This bar displays useful information for debugging applications and provides access to all logs with a single click:
Symfony2 presents its WebProfiler as the great evolution of the web debug toolbar. Whenever you view a page, Symfony2 generates a unique token debug (pictured above, the token is 4c7e59811509c). By clicking on that token, it shows the WebProfiler with all the debug information:
In the menu on the left side you can see the five main sections to the Profiler which now has:
Request: displays information about the request and response (parameters, cookies, headers).
Exception: if the request has caused an exception, it shows the type of exception, the message from the server and the whole execution trace.
Events: Shows the events raised during execution of the application (along with their event listeners) and the events that have been identified but have not come to run.
Logs: Displays the same information to log the original debug toolbar.
Doctrine / Propel: shows the queries to the database and the time taken for each.
Another great features of the Profiler is that it keeps all your information in a database called SQLiteprofiler.db and stored in the directory cache/ in your application. With this database, you’ll be able to consult the entire execution history of your application, which will facilitate the clearance of projects:
If you want to try the Profiler, you need version of the sandbox Symfony2 PR3, which has not yet been published as a downloadable file. Therefore, when you can only download via git:
mkdir sandbox
git clone http://github.com/symfony/symfony-sandbox.git sandbox
cd sandbox /
git checkout PR3
Now you can try accessing http://localhost/sandbox/index_dev.php Continue reading
Symfony Coding Standards
Following coding standards is one of the easiest way for everybody to understand everybody’s code.Here’s the golden rule: Imitate the existing symfony code. Never use tabulations in the code. Indentation is done by steps of 2 spaces: <?php class sfFoo … Continue reading
Type confusions in Symfony
I post this merely to point out how easy it is to forget to check EVERYTHING when you appear to have a bug. I’ve been trying unsuccessfully for the last hour to save a string to my database, like $myString … Continue reading
Before And After Action in Symfony
Ever wanted to run some functions or create some variables before every action in a module? Or ever wanted to do something crafty after every action and before the template gets displayed? Even if your answer is no, its good … Continue reading
Symfony Bloggers List
Hi There! I Am Adding This List For my Own Reference. Hope Some Of You Will Find It Usefull. All the blog feeds on this page are syndicated in the symfony planet feed. They often talk about symfony: 2nci Blog … Continue reading
Linking within the action, model and templates in Symfony
I continuously find myself looking these up, so I’m posting them here. Routing in Symfony is super easy, but remembering the proper method for calling upon routes can be mind scrambling. Generating links in a Template link_to(’Anchor Text’, ‘action/method?id=123′, array(’class’ … Continue reading
Finding a File in symfony
A Symfony Quickie: Finding a File from Klemen Slavič on Vimeo. here’s the gist of the video. The sfFinder class Symfony comes bundled with the sfFinder class that lets you conveniently search for files and directories. It has a simple … Continue reading


