Skip to content
This repository has been archived by the owner on Dec 3, 2018. It is now read-only.

Rename twig functions a use templates for html tags #1

Closed
hason opened this issue Jul 16, 2018 · 2 comments
Closed

Rename twig functions a use templates for html tags #1

hason opened this issue Jul 16, 2018 · 2 comments

Comments

@hason
Copy link

hason commented Jul 16, 2018

I think it's more consistent to rename twig functions to snake_case naming convention:
getWebpackCssFiles -> webpack_css_files
getWebpackJsFiles -> webpack_js_files

And instead of two additional functions renderWebpack*Tags I recommend using templates:

{% block javascripts %}
    {{ parent() }}
    {{ include('@WebpackEncore/script_tags.html.twig', { entry: 'entry1', prefix: 'build/' }) }}
{% endblock %}

{% block stylesheets %}
    {{ parent() }}
    {{ include('@WebpackEncore/link_tags.html.twig', { entry: 'entry1', prefix: 'build/' }) }}
{% endblock %}
@weaverryan
Copy link
Member

I think it's more consistent to rename twig functions to snake_case naming convention:

Hmm, you're right about that!

And instead of two additional functions renderWebpack*Tags I recommend using templates:

That's WAY more work, and the arguments (options in this case) are way less discoverable. But, we could actually create these templates, and have the renderWebpack*Tags() use them internally.

Thanks for the attention :)

@weaverryan
Copy link
Member

I've just renamed to lower case functions. But, I'm going to keep the extra "render" functions - I like them :)

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants