如何只为变量运行Zend引导程序,而不运行控制器


How to run Zend bootstrap only for variables, without running controller

如上所述。可能吗?运行$application->bootstrap()->run() 在索引控制器中处理索引操作,但我不需要它。

当然可以。

鉴于您有一个"默认",例如启动PHP文件,例如 https://github.com/zendframework/ZendSkeletonApplication/blob/zf/release-2.2.6/public/index.php

只需将最后一行从

Zend'Mvc'Application::init(require 'config/application.config.php')->run();

$app = Zend'Mvc'Application::init(require 'config/application.config.php');
//$app->run(); <- dont do this