Page 1 of 1

Zend Framework, Stylsheets and ID attributes

Posted: Tue Jan 13, 2009 6:22 am
by Chris Corbyn
I'm using ZF and I need to append a stylesheet to a specific page (not the entire site-wide layout).

I need my stylesheet to have an ID so that I can swap its href using JavaScript however ZF does not seem to support this.

Code: Select all

//This way has no ID parameter
$this->headLink()->appendStylesheet();
 
//This just blindly ignore both the id and type settings
$this->headLink(array(
  'rel' => 'stylesheet',
  'type' => 'text/css',
  'id' => 'themecss',
  'href' => '/kodify/themes/' . $this->theme . '.css'
));
 
Anyone have any suggestions? I guess I'll just have to skip Zend_View for this bit.

Re: Zend Framework, Stylsheets and ID attributes

Posted: Tue Jan 13, 2009 10:52 am
by Luke
Does it really?? That's really strange. Why don't you just extend that view helper and fix the problem?

Re: Zend Framework, Stylsheets and ID attributes

Posted: Tue Jan 13, 2009 11:31 pm
by Chris Corbyn
The Ninja Space Goat wrote:Does it really?? That's really strange. Why don't you just extend that view helper and fix the problem?
Because that would be too easy :lol:

No, that's the obvious solution, you're right, thanks :)