Zend Framework, Stylsheets and ID attributes

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Zend Framework, Stylsheets and ID attributes

Post 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.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Re: Zend Framework, Stylsheets and ID attributes

Post by Luke »

Does it really?? That's really strange. Why don't you just extend that view helper and fix the problem?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Zend Framework, Stylsheets and ID attributes

Post 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 :)
Post Reply