Is a good idea have a BaseController and make all controllers extend that class?

后端 未结 4 881
粉色の甜心
粉色の甜心 2020-12-20 06:13

I need some common behaviors in all controllers. Is a good idea have a BaseController and make all controllers extend that class? If so, What is the correct way to avoid the

4条回答
  •  北荒
    北荒 (楼主)
    2020-12-20 06:48

    Yes, this is a good idea and a very common pattern. Check out Subclassing the Action Controller section of the reference ZF manual.

提交回复
热议问题