Symfony Resources Central

Web development made simple

Keyword - css

Entries feed

The first sfDynamicsPlugin beta is out!

After a long alpha development stage, I released this morning the first BETA version of sfDynamicsPlugin. But... You may wonder, what is that?

sfDynamicsPlugin is a flexible assets manager for symfony which can be used to manage javascript libraries and their associated stylesheets. It supports packing, and CSS minifying, while keeping the full readable source in development environment.

Continue reading...

Don't be fooled by awkward view.yml js/css positionning syntax!

Short post today about advanced view.yml configuration (in symfony 1.0, and 1.1) for assets.

You can give additional options to "javascripts:" and "stylesheets:" sections, but the sin equa non condition is to know about the yet very un-documented view.yml assets syntax.

So here it is:

  javascripts: [ jquery: { position: first } ]
  stylesheets: [ mycss: { position: last, media: screen } ]

I don't know if there are others options like thoose available, but taken the 'position' attribute apart, which is extracted to become the $position method argument of sfWebResponse::addJavascript() and ::addStylesheet, any other option is passed in the $options array.

Methods prototypes below:

class sfWebResponse ...
{
  /* ... */
  public function addJavascript($js, $position = '', $options = array());
  public function addStylesheet($css, $position = '', $options = array());
  /* ... */
}

© Copyright 2007-2009 daKrazy. All rights reserved.

Design, template and content by Romain Dorgueil