Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only output css on assets.outputCss #2408

Closed
konsultaner opened this issue May 7, 2014 · 2 comments
Closed

only output css on assets.outputCss #2408

konsultaner opened this issue May 7, 2014 · 2 comments
Labels
bug A bug report status: low Low
Milestone

Comments

@konsultaner
Copy link

In my index.volt i used collections to output css an js like this

{% if cssCollections is defined and cssCollections is iterable %}
    {% for cssCollection in cssCollections %}
         {{ assets.outputCss(cssCollection) }}
    {% endfor %}
{% endif %}
{% if jsCollections is defined and jsCollections is iterable %}
    {% for jsCollection in jsCollections %}
         {{ assets.outputJs(jsCollection) }}
    {% endfor %}
{% endif %}

My controller adds a javascript and a css file to the same collection

$this->assets->collection('index')->addCss('css/index.css');
$this->assets->collection('index')->addJs('js/ng/index/app.js');

$this->view->cssCollections = array("index");
$this->view->jsCollections = array("index");

I assumed that the asset manager is smart enough to output one link tag and one script tag but in stead I got this result:

<link rel="stylesheet" href="http://localhost/css/index.css" type="text/css">
<link rel="stylesheet" href="http://localhost/js/ng/index/app.js" type="text/css">
<script src="http://localhost/css/index.css" type="text/javascript"></script>
<script src="http://localhost/js/ng/index/app.js" type="text/javascript"></script>

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@dancebear
Copy link
Contributor

\Phalcon\Assets\Manager::output has parameter $type but not used

@sergeyklay
Copy link
Member

Fixed in the 3.2.x branch. Feel free to open new issue if the problem appears again. Thank you for contributing.

@niden niden added bug A bug report status: low Low and removed Bug - Low labels Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug report status: low Low
Projects
None yet
Development

No branches or pull requests

4 participants