我创建了一组类,并希望使用 Zend 路由器对它们进行路由。
我的结构遵循以下模式:
/php/
/REST/
index.php
ClassOneService.php
ClassTwoService.php
ClassThreeService.php
我想通过 URL 访问类的方法(ClassOneService.php,...,ClassNService.php),例如:
class ClassOneService extends Connect {
public function test () {
echo 'hello';
}
}
穿过
http://localhost/php/REST/classe_one/test
我的问题是:我可以使用系统路由 Zend 而不在 Zend 中转换我的应用程序格式吗?
不想使用 MVC 模式,也不想将我的类扩展为 Zend 控制器的类,只需使用 Zend 路由器路由我的方法。