Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Assets - Cannot skip filter

Cannot skip filter, _filter always stay true;

This only happens with

$this->assets->collection(self::$COLLECTIONS[$name][0])->addJs('/', false, false);

Like this works

$this->assets->addJs('/', true, false)

but i need skip some in a collection!

["admin-core-js"]=> object(Phalcon\Assets\Collection)#102 (12) { ["_prefix":protected]=> NULL ["_local":protected]=> bool(true) ["_resources":protected]=> array(30) { [0]=> object(Phalcon\Assets\Resource\Js)#104 (8) { ["_type":protected]=> string(2) "js" ["_path":protected]=> string(1) "/" ["_local":protected]=> bool(false) ["_filter":protected]=> bool(true) ["_attributes":protected]=> array(0) { } ["_sourcePath":protected]=> NULL ["_targetPath":protected]=> NULL ["_targetUri":protected]=> NULL }



4.5k
Accepted
answer

$js = new \Phalcon\Assets\Resource\Js($path, $local, $filter); $this->assets->collection(self::$COLLECTIONS[$name][0])->add($js);

works, maybe is here the problem https://github.com/phalcon/cphalcon/blob/master/phalcon/assets/collection.zep

Line 142||170 if !filter { let filter = true; }