Takhir Berdyiev
Takhir Berdyiev

Reputation: 83

How can I include .less file in Zend Framework 2?

I can include .less file in such way:

<link rel="stylesheet/less" type="text/css" href="<?= $this->basePath('backoffice/less/master.less') ?>">

but how can I do this using ZF2, like have done with .css file

->prependStylesheet($this->basePath('backoffice/css/style.css')) 

Upvotes: 0

Views: 171

Answers (1)

danopz
danopz

Reputation: 3408

To create this link

<link rel="stylesheet/less" type="text/css" href="/backoffice/less/master.less">

You should be able to do:

->prependStylesheet(array(
    'rel' => 'stylesheet/less',
    'type' => 'text/css',
    'href' => $this->basePath('backoffice/less/master.less')
))

Not tested - only theoretically by looking into code.

Upvotes: 2

Related Questions