I am trying to call css and js from
Project/src/Front/bundle/AdminBundle/Resources/Public/css
OR js file
Project/src/Front/bundle/AdminBundle/Resources/Public/js
how can i include them in a proper way?
I am trying to call css and js from
Project/src/Front/bundle/AdminBundle/Resources/Public/css
OR js file
Project/src/Front/bundle/AdminBundle/Resources/Public/js
how can i include them in a proper way?
I would suggest adding to your twig blocks, this is typical usage, like so:
{% block stylesheets %}
<link rel="stylesheet" href="/css/main.css" />
{% endblock %}
...
{% block javascripts %}
<script src="{{ asset('script/myJavascript.js') }}"></script>
{% endblock %}
The above shows paths under the web folder, which is a good idea instead of your src folder. So css above is web/css/main.css and js path is web/script/myJavascript.js. That's a good way to do it. i show using asset() and without. You can try both to see what works best.
One of the solution I have found is....
php bin/console assets:install
now , check your web directory where all custom css/js folder are mirrored in "bundles"
How to include??
<link rel="stylesheet" href="{{ asset('bundles/bundlename/css/botstrap.css') }}"/>
So,It worked for me!!