Welcome Guest, Not a member yet? Register   Sign In
Best Way to get the current controller?
#1

[eluser]dsentker[/eluser]
Hey there,

in my view-file (main.view.php) i want to check if the controller 'admin' is loaded. Why that? Well, i've got this line:

Code:
<meta name="robots" content="index, follow">

And i want to change it to that:

Code:
<meta name="robots" content="noindex, nofollow">

if the admin-controller is loaded, cause google&co;should not recognize this path. What is the best way to get the current controller for my if/else inquiry?
#2

[eluser]Sbioko[/eluser]
You can get your controller's name using the following code:
Code:
$controller = $this->router->fetch_class();




Theme © iAndrew 2016 - Forum software by © MyBB