0

I am a newbie to symfony 2, so i used the traditionnal way of including bootstrap css and js files, and i faced the problem that the navbar is not working in my twig view, the code is working on a normal php web site. So here is my code

{%block header%}
{{ parent() }}
<div class="navbar navbar-inverse navbar-static-top">
        <div class="container">
            <button class = "navbar-toggle" data-toggle = "collapse" data-target = ".navbar-collapse"> 
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a href="#" class="navbar-brand">Ciné-tickets</a> 
            <div class="collapse navbar-collapse">
                <ul class="nav navbar-nav navbar-left">
                    <li><h1>test</h1></li>
                    <li><a href = "index.php">Accueil</a></li> 
                    <li class="dropdown">
                            <a href = "" class="dropdown-toggle" data-toggle="dropdown">Categories 
                                <i class="caret"></i>
                            </a>
                            <ul class="navbar-nav navbar-inverse dropdown-menu">
                                <li><a href = "marocain.php">Marocain</a></li>
                                <li><a href = "americain.php">Americain</a></li>
                                <li><a href = "egyptien.php">Egyptien</a></li>
                                <li><a href = "indian.php">Indian</a></li>
                            </ul>
                        </li> 
                    <li><a href = "#">Contact</a></li> 
                    <li><a href = "connexion.php">se connecter || s'inscrire</a></li>
                </ul>
            </div>  <!--fin collapse navbar-collapser-->
        </div> <!--fin container-->
    </div> <!--fin navbar navbar-inverse navbar-static-top-->

    {%endblock%}

nothing show up even the :

    <h1> TEST </h1>

Thank you

2
  • if nothing shown - check php error log Commented Apr 28, 2015 at 10:35
  • the problem is in the collapse class when i remove it the list show up , and i dont know why ? Commented Apr 28, 2015 at 10:41

1 Answer 1

1

to dump assets in to web folder you will need to run few commands in the command promt from your working derectory when working in symfony

php ./app/console assets:install ./web --env=prod
php ./app/console assetic:dump --env=prod

for further guidance you check the documentation : http://symfony.com/blog/new-in-symfony-2-6-smarter-assets-install-command

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

2 Comments

thsi is not the problem the assets are working the probleme i have is with bootstrap css
How did you include the header ? Your code works perfectly fine if I paste it, so I guess it might come from the include.

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.