Home  >  Q&A  >  body text

zend-framework - How to implement template switching in zf2

zf2 How to implement template switching

给我你的怀抱给我你的怀抱2688 days ago500

reply all(1)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-05-16 16:45:23

    use Zend\View\Model\ViewModel; // Add resource
    
    class IndexController extends AbstractActionController
    {
        public indexAction()
       {
           $viewModel = new ViewModel();
           $viewModel->setTemplate('application/index/index');
           return $viewModel;
        }
    

    For details, see: http://framework.zend.com/manual/2.2/en/modules/zend.view.quick-start.html

    reply
    0
  • Cancelreply