Augus
Augus

Reputation: 493

Codeigniter anchorlink in elseif statement

I got an elseif loop for status statements in my code. But now I want to make a div link with an id. Let me post the code I got now:

elseif($company['status'] == 2)
{ 
    echo "<p>Afspraak geplanned</p><p>"
    anchor('company/individual/'.$company['id'], 
         '<div class='maakqsaan'>Maak een quickscan</div>');
    "</p>";
}

And maybe as you can guess this isn't working...Could someone please help me?

Upvotes: 0

Views: 176

Answers (1)

Damien Pirsy
Damien Pirsy

Reputation: 25445

Your error is the incorrect use of quotes and concatenation (you can even see it in how the markup is colored in the code area. Doesn't your IDE of choice highlight invalid php? Just asking, it would help you a lot). Try this:

 elseif($company['status'] == 2)
 { 
    echo "<p>Afspraak geplanned</p><p>". anchor("company/individual/".$company['id'], "<div class='maakqsaan'>Maak een quickscan</div>")."</p>";
 }

Upvotes: 5

Related Questions