Removing stylesheets in symfony 1

Today I encountered a situation I've not encountered before: I have a project-wide stylesheet that should be used for everything, except one specific module that has different (brandable) stylesheets. I created a view.yml for this module with a different stylesheet, but of course the configuration files are merged so it doesn't actually overwrite the main stylesheet file. And this wasn't really what I needed here.

So I started searching around, and quickly found the removeStylesheet() method in the sfWebResponse class. This didn't work however, when I called this in my controller. Googling around a bit more I found this mailinglist discussion where Alexander Deruwe describes exactly what I need to do! Instead of removing it programmatically in the controller, I can just do it in my module view.yml file. So my view.yml of the module now looks like this:

stylesheets:    [-main, formdefault.css]

By negating a stylesheet that was added on a higher level of configuration, it is removed again from the set of stylesheets, and not added to the actual response. Thanks Alexander!


Add comment

Comments

gravatar Hair Extensions Bethesda md: This is very intriguing website. my partner and i adored to learn this kind of.. many thanks regarding revealing these records.
March 1, 2013
gravatar mp3 players orange: but this crosley record player also includes a par (portable audio ready) hookup for mp3 players, and an analog am/fm radio for more listening enjoyment. hello kitty kt2028a stereo cd boombox with cassette player/recorder and am/fm radio. 0.9" lcd bluetooth car kit mp3 player fm transmitter $21. playable file formats.
March 11, 2013
gravatar cereal box purse organizer: disclaimer: the information on this hub page does not constitute medical, legal, commercial, product, and/or service advice or endorsement of any vendor, supplier and/or brand, and does not necessarily reflect the opinion of the author. the tv dinner was first created in 1951, just in time to sit and eat while you watched that new, incredible invention -- the tv. .serials.[espaã±ol][rge][www.espaemule.com].zip now, there are simply no alternatives to fruity pebbles…except perhaps a bowl of soggy co-co puffs.
May 17, 2013
gravatar general mills individual cereal boxes: (con maní & sésamo). there will be plenty of time later for teaching and discipline but for now that precious infant is innocent and deserving of all the tenderness his or her parents can give. insofta cover commander multimedia & design - illustration, demo packmage cad software is a free packaging design software for corrugated cardboard and folding the symposium collected some 150 delegates, from more than 20 countries, mostly from europe.
May 22, 2013

Php5_zce_logo

Tags

1337 2008 2010 2011 4developers access modifiers accessibility AdaLovelaceDay09 advent agavi agile alfred amsterdam amsterdamphp apache api apple article articles atk atkMetaNode audioscrobbler autoloading automation azure backwards compatibility barcelona barcodes bash bbc bbq beatstad belgium best practices bittorrent blogging blogs boards of canada book books bughuntday bundle caching cake cal evans calendar career cat cerf certificate cfp cilex clear cms cologne common sense communities community components composer conference conferences contest continuous integration contribute contribution crisis css curl custom d-day data migration datetime DbFinderPlugin decorator decorators deployment deps devdays development directoryindex directoryiterator docblox doctrine doctrine2 documentation download dpc dpc09 dpc10 dpc11 DPC2008 dreamhost drupal dv7 eclipse ed editors efficiency enterprise errors event events expertise ezcomponents facebook filter-branch filteriterator finland flickr fork framework frameworks free ticket freelance freeze frontend fun game games geoip germany getting real git github globiterator gnome-do google google calendar googletalk graceful degradation hack hackers hidden gem hiphop howto hp HR html http i386 ibuildings icann ide ideasofmarch idm imovie inclusivity indy ingewikkeld integration international php conference internet interview ipad IPC ipc ipc08 ipc10 ipc11se iterators iterm2 javascript jenkins jenkins-php job job openings jobeet john peel joomla joomladays kiva kubuntu launcher launchy left on the web libcurl libraries library lighttpd lime linktuesday linux live london loudblog m2ts mac magazines malware mambo manchester marjolein mediterra meeting meme meta methodology micro-financing microframework microsoft migration movie music mysql namespace namespaces netbeans netherlands newsfire nllgg northeastphp nos odmarco open source opinion ORM osx paradiso paris partnership pavilion pear pecl performance personal pfc10 pfc11 pfcongres pfcongrez pfz pfz.nl photo php PHP php5.3 phpabstract phpazure phpBB phpbb phpbelgium phpbenelux phpbnl10 phpday phpdoc phpdocumentor phpgg phpitalia phpnw phpnw08 phpnw11 phpnw12 phpstorm phptek phptek09 phpuk2009 phpUnderControl phpunit php|architect php|tek podcast politics portability postcrossing presentation presentations private projects protected prototype PSR-0 public python qa qr codes re2c recruiting refactoring review rewrite ruby on rails san francisco schedule scifi script security sensio seven things sexism sfdaycgn sflive2011 shell scripting silex simplexml slides smfony software sogeti solar sound speakers spl ssh standard standards star trek static steer strings stylesheets subversion symfony symfony live symfony2 Symfony2 symfonycamp symfonyday symfonylive symfonyUnderControlPlugin talk talks tech techademy technology techportal tek09 telecommuting terratec terrorism testfest testing textmate textpattern the right tool timeout tips tld todo tomas tools training twig uncon unet usability usergroup validation vhost video vim vinyl virus warp webinar weblogging webservices wiki windows winphp women wordpress work workshop world world of warcraft wpi writing wunderlist xml xpath xsd yara year youtube zc11 ZCE zemanta zend zend framework zend server zend studio zendcon Zend_Form zite
© 2004 - 2013 Stefan Koopmanschap + Powered by Symfony, photos powered by Flickr, links powered by Delicious, Shanghai smilies by Iconbuffet. Feeds: rss / atom. Left on the Web v4.4.0.1