Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get current controller and method #62

Closed
wants to merge 6 commits into from
Closed

Get current controller and method #62

wants to merge 6 commits into from

Conversation

zimt28
Copy link
Contributor

@zimt28 zimt28 commented Jan 15, 2013

Simple helper to get the current action like "Controllers\Home@getIndex".
Going to return null if function called on non-controller request.

@daylerees
Copy link
Contributor

Could you add a/some unit tests for this please? An example of what happens when using the method from a routed closure would also be interesting :)

Thanks!

@Kindari
Copy link

Kindari commented Jan 16, 2013

Also shouldn't it be currentAction instead of current_action

@antonioribeiro
Copy link
Contributor

Specifically at vendor/laravel/framework/src/Illuminate/Support/helpers.php functions names are still in snake_case.

@zimt28
Copy link
Contributor Author

zimt28 commented Jan 16, 2013

Would love to but I have to admit that I could need some help ;)
@Kindari No, all helper functions follow that style.

@zimt28
Copy link
Contributor Author

zimt28 commented Jan 16, 2013

This took me like 3 hours, first tests I ever wrote :o
Are they useful?

@daylerees Will find your example in tests :)

@Sopamo
Copy link
Contributor

Sopamo commented Jan 25, 2013

👍 This is really a missing feature!

@bencorlett
Copy link
Contributor

+1

2 similar comments
@pkat
Copy link

pkat commented Mar 10, 2013

+1

@sarunast
Copy link

👍

@asmerkin
Copy link

+1

@jrahmy
Copy link

jrahmy commented Jul 10, 2013

@asmerkin This was already implemented.... Route::currentRouteAction()

@asmerkin
Copy link

Thanks

@asmerkin
Copy link

Sorry, but i can't execute that method. It seems not to be in Laravel 4 and it's not in the api docs.

@asmerkin
Copy link

it's Route::currentRouteAction() in Laravel 4 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.