<?php /** * AbstractController.class.php * $author$ */ namespace Apicp\Controller\Category; use Common\Service\CategoryService; use Common\Service\PaperService; abstract class AbstractController extends \Apicp\Controller\AbstractController { /** @var CategoryService 初始化试卷分类表 */ protected $cate_service; /** @var PaperService 初始化试卷表 */ protected $paper_service; public function before_action($action = '') { if (!parent::before_action($action)) { return false; } $this->cate_service = new CategoryService(); $this->paper_service = new PaperService(); return true; } }