Archive

Archive for the ‘symfony’ Category

Youtube and Symfony Application Built In Only 6 Hrs

May 31st, 2008

Hi ,

I am back after a long gap ( due to my final semester exams).

This post is about my new R&D application. Last week all of sudden I got an idea to have my own cartoon website.The main purpose of the website is to bring the good collections of cartoon videos at one location. For this I initially thought to put a wordpress blog and use some plugins to get videos from youtube. But after looking into Youtube API and i found a good php client library for youtube developed by ZEND. This library is a part of Zend Framework. you can aslo use the library in any standalone php application

Using this library we can play with all google apps like docs, calendar, spreadsheet, apps, youtube… etc. After 2 days of research i thought to write the application this weekend. and on first day itself that too within 6 hrs I designed the base model with few symfony actions and partials. and I named it CartoonRiders

Currently the application is having the following features.

  • Categories of different cartoon characters
  • Display the list of related video thumbnails
  • Simple keyword search

Please check CartoonRiders and leave your Feedback / inputs to improve the application.

–Asif–

symfony, youtube

Multiple themes for symfony application

March 31st, 2008

Hi,

After a long time i am posting my experience. This post describes the ways to implement multiple themes/skin in symfony application.I found many posts in symfony forum regarding themes and somebody suggested to use this plugin ysfDimensionsPlugin . This is really a great plugin and thanks to Yahoo for providing such a great plugin.There is no automatic installation for this plugin as it replaces 2 symfony core files. To install this plugin first you need to get the Tar file then extract it to your symfony application’s plugin directory.

Now take a back up of the files 2files by running these command. (path is specific to my system)

 

  • cp /usr/local/lib/php/symfony/config/sfLoader.class.php /usr/local/lib/php/symfony/config/sfLoader.class.php.original
  • cp /usr/local/lib/php/data/symfony/config/constants.php /usr/local/lib/php/data/symfony/config/constants.php.original

Now go to your application plugin directory

  • cd /path/to/your/symfony/application/plugin/directory
  • cp lib/config/sfLoader.class.php /usr/local/lib/php/symfony/config/sfLoader.class.php
  • cp config/constants.php /usr/local/lib/php/data/symfony/config/constants.php

Aftre this you need to add the following code to symfony project’s config.php

$culture = if(!empty($_REQUEST['culture'])) ? $_REQUEST['culture'] : 'en';

$theme = if(!empty($_REQUEST['theme'])) ? $_REQUEST['theme'] : 'classic';// define dimensions

$dimension = array('culture' => $culture, 'theme' => $theme);

// no autoloading available this early in bootstrap, so require absolutely

require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.'ysfDimensionsPlugin'.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'sfDimensions.class.php');

// set dimensions

sfDimensions::setDimension($dimension);


Now create a dimentions.yml in the project config. this will list all the possible themes you will have for an application

dimensions:
  culture: 		  [en, fr, it, de]
  theme: 		  [classic, corporate]

Now you are ready to play with this plugin.

How it works: This plugin takes the advantage of symfony configuration features and allows you to configure three parts of application (configuration, templates, actions) . Now i will tell you how to configure the configuration part and template part for different themes.

For example you have 3 themes ( 3 different layout.php files) for your application. place those files in the following way.

  1. apps/frontend/templates/theme1/layout.php
  2. apps/frontend/templates/theme2/layout.php
  3. apps/frontend/templates/theme3/layout.php

As every theme has its own css/js files you need to tell the application which one to pick in the following way.

  • apps/frontend/config/theme1/view.yml
  • apps/frontend/config/theme2/view.yml
  • apps/frontend/config/theme3/view.yml

Now you have defined a seperate view.yml for each theme. Now you are done with multiple themes for single application. now clear your cache and test the output by passing a theme parameter in query string

  • http://localhost/frontend_dev.php/?theme=theme1
  • http://localhost/frontend_dev.php/?theme=theme2
  • http://localhost/frontend_dev.php/?theme=theme3

That’s it… you got it…
This post only gives a brief info to start with this plugin. There are lots of customization you can to using this plugin. for example you can have culture based themes as well. Please check the plugin trac to know more about the plugin.

Asif

plugins, symfony, themes

Update on symfony

September 4th, 2007

As the Symfony development team reaches towards the new beta release of symfony 1.1 , Fabien decided to delegate the responsibility of maintaining the 1.0 branch to two new persons Noël Guilbert and Grégoire Hubert. Their responsibilities include planning the coming releases, choosing the tickets to be included and the general packaging of the releases.

And the main development team continues refactorization of core components and prepares the upgrading process. Symfony popularity grows day by day as many of the people contributing in the community, more and more bloggers writing about the symfony and Many public sites powered by the Symfony

–Asif–

symfony

my first symfony plugin

July 19th, 2007

Hi,

its been a year since i started using the symfony framework  in all my projects.and i have seen a lot of contribution to symfony from all over the developer community. and this support from other developers made me to write my own plugin. i have just released sfContactGrabberPlugin. This plugin will be used to grab the address book from the yahoo/gmail / myspace. I am going to add MSN , Orkut and Rediff support in the plugin.

For more information on installing and using the plugin check this

–Asif–

symfony

Single session for all sub domains

July 1st, 2007

Hi,

When you are having sub domain in your site by default the php will create a session for each of the sub domain for a user. you can not access the session $value1 of subdomain1 in the subdomain2 session. because the sessions are different for each sub domain for the same user. To make only one session for all the sub domain you need to set the a cookie with a .domain.com value for the domain parameter.

<?php
setcookie("TestCookie", $value, time()+3600, "/~tmp/", ".youdomain.com");
?>

Symfony Code:

in your application /config/factories.yml file add the following lines


storage:
class: sfSessionStorage
param:
session_name: symfony
session_cookie_domain: .yourdomain.com

now the user will be having only one session for all the sub domains.

–Asif–

symfony

Why Symfony?

June 16th, 2007

Hi,

There are many frameworks out there on the web. but how to choose the best one.
as per my experience and research i found that the Django is in first place but this requires Python language skills.
and in Ruby On Rails is on the second place again this framework requires the basic understanding of Ruby Language.
If you are a Php programmer then why do you go for this. The Symfony is very best option for any Php developer to start working on framework. many big size portals are already using the power of symfony. There is no need to switch to any other language from your favorite PHP.

Here is the official list of sites which are powered by symfony

–Asif–

symfony

Symfony

June 4th, 2007

Hi…

symfony is the only framework with a bundle of features and lot more. Actual the tag line is very impressive and i feel that best suits me. “Symfony for Lazy Folks”. And as a Lazy person i always dont want to do the same things again and again and thanks for the symfony which do all the things automatically on simple instruction. since last 10 months i am implementing all my projects using the Symfony Framework. And i can say that every day i learn atleast one new thing about symfony.
Just recently we have completed a social networking project which is fully powered with the Symfony Framework.

Thanks to Symfony .. that really Rocks…. :-)

–Asif–

symfony

Powered by Yahoo! Answers