深入理解 ZF 分配循环(Dispatcher工作原理)

WBOY
Libérer: 2016-07-25 09:10:23
original
949 Les gens l'ont consulté
  1. public function fooAction()

  2. {
  3. // forward to another action in the current controller and module:
  4. $this->_forward('bar', null, null, array('baz' => 'bogus'));
  5. }
  6. public function barAction()

  7. {
  8. // forward to an action in another controller, FooController::bazAction(),
  9. // in the current module:
  10. $this->_forward('baz', 'foo', null, array('baz' => 'bogus'));
  11. }
  12. public function bazAction()

  13. {
  14. // forward to an action in another controller in another module,
  15. // Foo_BarController::bazAction():
  16. $this->_forward('baz', 'bar', 'foo', array('baz' => 'bogus'));
  17. }
  18. ?>
复制代码

总结:Dispatcher 是 ZF 实现 MVC的重要组成部分,理解Dipatcher的功能对我们更好的应用 ZF或其它框架有很重要的意义。 可以认为分配的作用就类似于,在路由之后执行相应行为的一个过程,然后 返回response 对象。



source:php.cn
Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Tutoriels populaires
Plus>
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!