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

Controllers overriding

lifeisfoolifeisfoo Zombie plugins finder ✭✭✭

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

  • Options

    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.

  • Options
    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.

  • Options
    lifeisfoolifeisfoo Zombie plugins finder ✭✭✭

    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.

  • Options

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

    grep is your friend.

  • Options
    lifeisfoolifeisfoo Zombie plugins finder ✭✭✭

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

    There was an error rendering this rich post.

  • Options

    it is written in the docs

    grep is your friend.

  • Options
    lifeisfoolifeisfoo Zombie plugins finder ✭✭✭

    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.

  • Options

    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.