thinkphp如何继承自己的Action

WBOY
Release: 2016-06-13 13:45:21
Original
1124 people have browsed it

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()
  {

  }

}
Copy after login


IndexAction.class.php
PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->class IndexAction extends GlobalAction
{

}
Copy after login


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

------解决方案--------------------
class IndexAction extends GlobalAction之前,GlobalAction.class.php必须被加载进来,不然肯定会报错的。
------解决方案--------------------
include(__APP__/lib/GlobalAction.class.php)
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template