0

I'm having a small problem with dropdown menu and mine controller, I have on my controller the variable for the dropdown content but it dont show on the webpage only those 3 dont work {$DEN}, {$DPT} and {$DES}

Here is the HMTL

<div class="top-nav">
    <nav class="navbar navbar-default">
        <div class="container">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">Menu                       
            </button>
            <!-- Collect the nav links, forms, and other content for toggling -->
            
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                    <img src="{$favlogo}" alt="" width="8%" height="auto">
                    <li class="hvr-bounce-to-bottom active">{$homebar}</li>
                    <li class="hvr-bounce-to-bottom">{$aboutUs}</li>
                    <li class="hvr-bounce-to-bottom">{$servicos}</li>
                    <li class="hvr-bounce-to-bottom">{$galeria}</li>
                    <li class="hvr-bounce-to-bottom">{$equipa}</li>
                    <li class="hvr-bounce-to-bottom">{$contactUs}</li>
                    <li class="hvr-bounce-to-bottom">{$user}</li>
                    <li class="hvr-bounce-to-bottom">{$login}</li>
                    <li class="hvr-bounce-to-bottom">{$logout}</li>
                    <li class="hvr-bounce-to-bottom">{$email}</li>
                    <li class="hvr-bounce-to-bottom">{$contacto}</li>
                    <li class="dropdown">
                        <a href="javascript:void(0)" class="dropbtn">Idioma</a>
                        <div class="dropdown-content">
                            {$DEN}
                            {$DPT}
                            {$DES}
                        </div>
                    </li>
                </ul>   
                <div class="clearfix"> </div>
            </div>  
        </div>
    </nav>      
</div>  

And here is the Controller code for this part

        $data['DPT'] = '<a href="'.base_url('index.php/cart/indexPT').'">Português</a>'; 
        $data['DEN'] = '<a href="'.base_url('index.php/cart/indexEN').'">English</a>'; 
        $data['DES'] = '<a href="'.base_url('index.php/cart/indexES').'">Español</a>'; 

                    //------------------ FOOTER              ----------------------
        $data['footercontactUS'] = '<a href="'.base_url('index.php/cart/contactUS').'">Contacte-nos</a>';
        $data['footeraboutUS'] = '<a href="'.base_url('index.php/cart/aboutUS').'">Sobre Nós</a>';
        return $data;

1 Answer 1

1

The easier way is to use the full address to the href.

In your view

<a href="https://www.example.com/index.php/cart/indexPT">Português</a>
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.