0
ViewModel 클래스를 반환 할 때 기본적으로 setTerminal = true 매개 변수가 있으므로 모든 액션을 설정하고 싶습니다.Zend Framework 2 기본적으로 레이아웃이없는 작업
제 전화의 90 %가 AJAX이기 때문에 제 응용 프로그램에 이러한 동작이 나타나기를 바랍니다.
미리 감사드립니다.
ViewModel 클래스를 반환 할 때 기본적으로 setTerminal = true 매개 변수가 있으므로 모든 액션을 설정하고 싶습니다.Zend Framework 2 기본적으로 레이아웃이없는 작업
제 전화의 90 %가 AJAX이기 때문에 제 응용 프로그램에 이러한 동작이 나타나기를 바랍니다.
미리 감사드립니다.
대체 렌더링 및 응답 전략 생성 및 등록을 확인하십시오. http://framework.zend.com/manual/2.0/en/modules/zend.view.quick-start.html#creating-and-registering-alternate-rendering-and-response-strategies.
네임 스페이스 응용 프로그램;
class Module
{
public function onBootstrap($e)
{
// Register a "render" event, at high priority (so it executes prior
// to the view attempting to render)
$app = $e->getApplication();
$app->getEventManager()->attach('render', array($this, 'registerJsonStrategy'), 100);
}
public function registerJsonStrategy($e)
{
$app = $e->getTarget();
$locator = $app->getServiceManager();
$view = $locator->get('Zend\View\View');
$jsonStrategy = $locator->get('ViewJsonStrategy');
// Attach strategy, which is a listener aggregate, at high priority
$view->getEventManager()->attach($jsonStrategy, 100);
}
}