Answer the question
In order to leave comments, you need to log in
How to create your own FilterInterface on phalcon?
docs.phalconphp.ru/ru/latest/reference/assets.html#id7
There is an example in the article, let's say I want to test it, where should I connect it?
<?php
use Phalcon\Assets\FilterInterface;
/**
* Filters CSS content using YUI
*
* @param string $contents
* @return string
*/
class CssYUICompressor implements FilterInterface
{
protected $_options;
.....
// Get some CSS collection
$css = $this->assets->get("head");
// Add/Enable the YUI compressor filter in the collection
$css->addFilter(
new CssYUICompressor(
[
"java-bin" => "/usr/local/bin/java",
"yui" => "/some/path/yuicompressor-x.y.z.jar",
"extra-options" => "--charset utf8",
]
)
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question