Maison  >  Article  >  développement back-end  >  thinkphp如何继承自己的Action

thinkphp如何继承自己的Action

WBOY
WBOYoriginal
2016-06-13 10:05:39806parcourir

thinkphp怎么继承自己的Action
GlobalAction.class.php

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->class GlobalAction extends Action{  public function _initialize()  {  }}


IndexAction.class.php
PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->class IndexAction extends GlobalAction{}


我这么写结果报错,说GlobalAction没有找到

------解决方案--------------------
class IndexAction extends GlobalAction之前,GlobalAction.class.php必须被加载进来,不然肯定会报错的。
------解决方案--------------------
include(__APP__/lib/GlobalAction.class.php)
Déclaration:
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