Having a single entry point to a website. Bad? Good? Non-issue?

前端 未结 9 1241
你的背包
你的背包 2020-12-15 05:16

This question stems from watching Rasmus Lerdorf\'s talk from Drupalcon. This question and his talk have nothing specifically to do with Drupal, by the way... it was just gi

9条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-15 05:23

    This is what I thought at first, but it doesn't seem to be an impact. After all, your entry point is (usually) only doing a couple of things: setting some environment constants, including the bootstrap loader, optionally catching any exceptions thrown and dispatching the front controller. I think the reason that this is not inefficient is because this file does not change depending on the controller, action or even user.

    I do feel this is odd however. I'm building a small MVC framework myself at the moment but it's slightly reverse to most frameworks I've used. I put controller logic in the accessed file. For example, index.php would contain the IndexController and it's actions. This approach is working well for me at least.

提交回复
热议问题