title: How to add an action in a nav-link in php
body: <p>I've a project where i need to use the MVC2 architecture. So far so good, but I'm stuck with the navigation bar.</p>
  
  <p>Basically, I'm making a webpage where I have a navigation bar with different options available. When I click in one of the options, I want an "action" to be made, which would be sent to an Action Builder Class which would generate a view with the specific page.</p>
  
  <p>For instance, this is my ActionBuilder class, which is in my Controler folder</p>
  
  <pre><code>&lt;?php
  require_once('./controleur/DefaultAction.class.php');
  require_once('./controleur/MenuAction.class.php');
  require_once('./controleur/LogginAction.class.php');
  require_once('./controleur/ContactAction.class.php');
  
  class ActionBuilder{
  public static function getAction($nomAction){
      switch ($nomAction)
      {
              case "Menu" :
              return new MenuAction();
              break; 
                  case "Tarification" :
                  return new TarificationAction();
                  break; 
                      case "Contact" :
                      return new ContactAction();
                      break; 
          default :
              return new DefaultAction();
      }
  }
  }
  ?&gt;
  </code></pre>
  
  <p>Here is my css:</p>
  
  <pre><code>  &lt;form method="post" action=""&gt;
      &lt;nav class="navbar navbar-expand-lg navbar-dark bg-primary"&gt;
            &lt;div class="navbar-collapse collapse show" id="navbarColor01" style=""&gt;
              &lt;ul class="navbar-nav mr-auto"&gt;
                    &lt;li class="nav-item"&gt;
                            &lt;a class="nav-link" href="#" id="APropos"&gt;À propos&lt;/a&gt;
                          &lt;/li&gt;
                          &lt;li class="nav-item"&gt;
                            &lt;a class="nav-link" href="#" id="Tarification"&gt;Tarif&lt;/a&gt;
                          &lt;/li&gt;
                          &lt;li class="nav-item"&gt;
                              &lt;a class="nav-link" href="MenuOffert.php"&gt;Menus offert&lt;/a&gt; 
                            &lt;/li&gt;
                            &lt;li class="nav-item"&gt;
                              &lt;a class="nav-link" href="#"  id="Contact"&gt;Nous contacter&lt;/a&gt;
                            &lt;/li&gt;
                            &lt;li class="nav-item"&gt;
                              &lt;a class="nav-link" href="Loggin.PHP"&gt;Se connecter&lt;/a&gt;
                            &lt;/li&gt;
  
              &lt;/ul&gt;
            &lt;/div&gt;
          &lt;/nav&gt; 
  </code></pre>
  
  <p>After we clicked, for example Contacter in the navigation bar, what I need is to send an action to the controler which would call this ContactAction class:</p>
  
  <pre><code>  &lt;?php
   require_once('./controleur/Action.interface.php');
  class ContactAction implements Action {
  public function execute(){
      return "Contact";
    }
   }
  </code></pre>
  
  <p>which eventually would show the page with the info that I need.
  How can I do this? </p>
  
  <p>Also, do I have to set a form in the navigation bar as I did? I'm really not sure for that part. </p>
  
  <p>Thank you.</p>