Welcome Guest, Not a member yet? Register   Sign In
anchor tag and its parameters
#1

[eluser]deco10[/eluser]
Is it possible to give anchor() an array like this?

$mylink = array("home/mypage", "Link Text", array("title" => "This is a test link", "class" => "biglink"));

<?= anchor($mylink) ?>



Its a link in a navigation panel that changes depending on the page that it is loaded from (product, information, faq, home). The same link appears at different times, so it would be nice to have it declared once so I can change it easily.


Suggestions?
#2

[eluser]Thorpe Obazee[/eluser]
You can always set it to a variable.

Code:
//Controller
$data['anchor']  = anchor(“home/mypage”, “Link Text”, array(“title” => “This is a test link”, “class” => “biglink”));
$this->load->vars($data);

Code:
<?php
// View
echo $anchor;?>
#3

[eluser]Zeeshan Rasool[/eluser]
Yes offcourse,
you can even pass whole view data from controller.




Theme © iAndrew 2016 - Forum software by © MyBB