Friday, February 5, 2010

Javascript: table cell highlighting on radio button change

Below code for making table cell highlight on change of radio-button.

In Head Section:

In Body tag :

Monday, February 1, 2010

Session in Symfony

setting of session in symfony --
in action.class.php
session object for the current user is accessed in the action with the getUser() method and is an instance of the sfUser class.
This class contains a parameter holder that allows you to store any user attribute in it.
class myModule extends sfActions
   public function executeFirst()
    $name = $this->getRequestParameter('name');
    $this->getUser()->setAttribute('name', $name);
   public function executeSecond()
    $ses_name = $this->getUser()->getAttribute('name'); //Retrieve session values

attributes are stored in a parameter holder that can be accessed by the getAttributeHolder() method. It allows for easy clean-up of the user attributes with the usual parameter holder methods.

//To remove session variable

//To clear session varaible

In Template:
The user session attributes are also available in the templates by default via the $sf_user variable, which stores the current sfUser object.