I want to create Auto breadcrumb as array contain sub arrays with 2 keys ( link, title ). like this:
array (
0 => array (
'link' => 'index',
'title' => 'Home :)',
),
1 => array (
'link' => 'advanced',
'title' => 'Advanced Setting :)'
)
);
Note
when i use the following code it give me this result but i cannot get the title as you can see on the variable $mytitle
.
class Setting extends Controller {
public function __construct() {
$relflection = new ReflectionClass ( get_class ( $this ) );
$methods = $relflection->getMethods ( ReflectionMethod::IS_PUBLIC );
if (is_array ( $methods )) {
foreach ( $methods as $method ) {
if ($method->class == get_class ( $this )) {
$breadcrumb[] = array("link" => $method->name, "title" => "???");
}
}
}
$breadcrumb = $breadcrumb;
}
public function index() {
$mytitle = "Home :)";
}
public function advanced() {
$mytitle = "Advanced Setting :)";
}
}
Can anyone here give me a right solution for this?