question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Best practice to access other controllers methods

See original GitHub issue

What will be the best practice to access methods of one controller from another without creating a new instance?

For example I want to access methods of SomethingController from StartController which displays the ‘/start’ menu.

In previous version there was a method $.routeTo('/something')

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
Naltoxcommented, Jun 29, 2016

@Konfuze Hi! There is no such opportunity yet, but i will add routeTo method soon.

0reactions
herenicknamecommented, Aug 4, 2017

@osadchiynikita and how to route? Where I can define the route?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Best practice accessing other controller method - Laracasts
Another option is to create a trait containing the "common code" and use that trait in each controller that needs it giving you...
Read more >
Is it good practise to access methods of one controller from ...
It's not a question of good and bad. Sometimes it's just necessary. The most common ways are: Define good interfaces between controllers ......
Read more >
Access Controller method from another controller in Laravel 5
The best approach will be to create a trait (e.g. in app/Traits ), implement the logic there and tell your controllers to use...
Read more >
10 Things You Should Avoid in Your ASP.NET Core Controllers
Data Access Logic · Business Logic · Mapping Model Classes Manually · Exception Handling · Repetitive Logic (Action Filters) · Manual Authorization.
Read more >
Action Controller Overview - Ruby on Rails Guides
It is a best practice to lower the visibility of methods (with private or protected ) which are not intended to be actions,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found