How can you access a controller that is 3 layers deep in Laravel 3?
So it seems like this is a routing issue, but I cannot access my
controller from another controller. Here is my controller structure:
controllers --api ----v1 ------exercises.php ------helpers.php
------routines.php --groups ----admin.php ----users.php --reports.php
--totals.php
So the issue is accessing any of my api controllers from another
controller. I can hit any of them just fine by hitting a url like
mysite.com/index.php/api/v1/routines/routine/1, but I accessing them from
another controller is out of the question.
Here's an example:
If I want to access method() from the Groups_Users controller, using my
Reports controller, all I would do is this:
Groups\Users::method()
However, if I want to access api_method() from the Api_V1_Exercises
controller, using any other controller, I would think that it would be the
same, like this:
Api\V1\Exercises::api_method()
This DOES NOT work, and I have NO idea why... I've tried doing the
underscores instead of using the back slash character, but no help there
either.
What am I doing wrong? I really could use some help figuring this one out.
No comments:
Post a Comment