-1

I tried it many time, but not able to execute it.

Already I have a static website and it not working if I change its extension to twig format, like index.html to index.html.twig.(css and javascript not working if I use twig)

6
  • sorry for bad english Commented Feb 28, 2014 at 13:52
  • Is this template called from php action (rendered by Symfony)? Commented Feb 28, 2014 at 13:57
  • public function indexAction() { return $this->render('AcmeCmsadminBundle:Default:index.html.twig'); } Commented Feb 28, 2014 at 13:58
  • And what do You mean by "not working"? Do You see any error message (when running it in dev environment)? Commented Feb 28, 2014 at 14:02
  • already i have a html static web pages and if i use it with symfony 'VIEW' then its css and javascript not working Commented Feb 28, 2014 at 14:05

1 Answer 1

0

To include css and js files the easiest (but not recommended) way is to put css and js files inside /web/ directory and in template file include it by relative path (when "web" directory is treated as main site directory).

If You want to read about proper way of doing it look:

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.