switch case does not execute

-1

I have the following code:

<aside class="main-sidebar">
  <!-- sidebar: style can be found in sidebar.less -->
  <section class="sidebar">
    <!-- Sidebar user panel -->
    <!-- sidebar menu: : style can be found in sidebar.less -->
    <ul class="sidebar-menu" data-widget="tree">
      <li class="header">MENU</li>
      <li class="active treeview">
        <a href="?rotina=perfil">
          <i class="fa fa-dashboard"></i> <span>Dashboard</span>
        </a>
      </li>
      <li class="treeview">
        <a href="?rotina=profile">
          <i class="fa fa-user"></i>
          <span>Meu Perfil</span>
        </a>
      </li>
      <li>
        <a href="?rotina=curriculum">
          <i class="fa fa-laptop"></i> <span>Meus Cursos</span>
        </a>
      </li>
      <li>
        <a href="pages/widgets.html">
          <i class="fa fa-edit"></i> <span>Meu Curriculum</span>
        </a>
      </li>
    </ul>

  </section>

</aside>

  <?php 

    $tela = "";

    if(!isset($_GET['rotina'])){

      $tela = "homesys.php"; 

   } else {

    $rotina = $_GET['rotina'];

    switch($rotina) {

      case "profile":

        echo $rotina;

        // $tela = "perfil.php"; 
        break;    

      default: 
        $tela = "homesys.php"; 
        break;    

    }

  }

  ?>

  <div class="content-wrapper">

    <?php include_once("../views/$tela");?>

  </div>

When I click on the My Profile option, switch case does not execute. Where is the error?

    
asked by anonymous 17.09.2018 / 18:34

1 answer

2

You need to put the $ screen variable between braces. Use the following code: <?php include_once("../views/{$tela}");?> .

And another, the $tela = "perfil.php"; stretch inside the profile case is commented on in your code.

    
17.09.2018 / 18:41