Welcome Guest, Not a member yet? Register   Sign In
how shall i redirect to a controller from other.
#1

[eluser]Sumon[/eluser]
lets say i have two controller. first one is FIRST and 2nd one is SECOND. Now i like to redirect to FIRST from SECOND controller for a specific condition. Now i shall be happy if anyone please let me know how to redirect to FIRST controller from a function in SECOND controller.
#2

[eluser]xwero[/eluser]
if you add the url helper you can do
Code:
class first extends Controller
{

   function testredirect()
   {
      redirect('second/first');
   }

   function second()
   {
      echo "I'm redirected from the second controller";
   }
}

class second extends Controller
{

   function testredirect()
   {
      redirect('first/second');
   }

   function first()
   {
      echo "I'm redirected from the first controller";
   }
}
You can redirect within controllers too with redirect.
#3

[eluser]Sumon[/eluser]
Thanks Bro.........

Now i am able to redirect to any controller successfully. Thanks.




Theme © iAndrew 2016 - Forum software by © MyBB