HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Controllers overriding

Is it possible to override a core controller from a plugin?

I've done this for a model class, just adding the file into the plugin directory.

There was an error rendering this rich post.

Best Answer

Answers

  • You want to override a controller method? It is possible.

    You must avoid stuff like this you can, it is the tail wagging the dog. A whole class is a pretty big thing to override. Overriding methods should be a last resort, it is rarely necessary.

    Better to reroute, if that is even necessary.

    grep is your friend.

  • x00x00 MVP
    edited July 2013

    Since you can use any model you like there is little reason to override one. You could extend, or create a new one.

    grep is your friend.

  • lifeisfoolifeisfoo ✭✭✭

    The class that I need to override is the search controller class. I need to do that to fit my (search) needs. Unfortunately there isn't any hook in the controller...

    Vanilla 2.1

    There was an error rendering this rich post.

  • You can override methods, you can also reroute and use you own.

    grep is your friend.

  • lifeisfoolifeisfoo ✭✭✭

    Can you explain how to do that (override a controller method)?

    There was an error rendering this rich post.

  • it is written in the docs

    grep is your friend.

  • lifeisfoolifeisfoo ✭✭✭

    Thank you, but I've created a controller in a my custom application with custom search model,etc to solve this...

    There was an error rendering this rich post.

  • well that is what I'm saying, it is better not to override methods. You might look at how sphinx search does it.

    grep is your friend.

Sign In or Register to comment.