0

I have a little problem with my partials in zf3, trying to add css in partial it doesn't work anymore as in zf2, this is my code:

<?php $this->headLink()->prependStylesheet($this->serverUrl() . '/path/to/css_file.css');?>

If anyone has any solution, I would greatly appreciate.

Suhaib Janjua
  • 3,538
  • 16
  • 59
  • 73

1 Answers1

0

you forgot the sweety echo function :)

<?php echo $this->headLink()->prependStylesheet($this->serverUrl() . '/path/to/css_file.css');?>
Fadel
  • 701
  • 10
  • 12
  • If i put echo works but...duplicate all css...they say...don't echo individual files – user2177458 Apr 06 '17 at 17:29
  • What i try to do: use view helper as widget system (view helper with view file) Application\Widget\Init.php looks like: `view->render('widget/widget1/view.phtml'); } }` widget\widget1\view.phtml ` headLink()->appendStylesheet('file.css') ?>` the problem is: if I call this widget from layout.phtml, headLink is not call, but, if i call same widget in any other view, is ok load that css file – user2177458 Apr 11 '17 at 20:01