当前位置: 首页>>代码示例>>PHP>>正文


PHP JsonModel::setTemplate方法代码示例

本文整理汇总了PHP中Zend\View\Model\JsonModel::setTemplate方法的典型用法代码示例。如果您正苦于以下问题:PHP JsonModel::setTemplate方法的具体用法?PHP JsonModel::setTemplate怎么用?PHP JsonModel::setTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend\View\Model\JsonModel的用法示例。


在下文中一共展示了JsonModel::setTemplate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __invoke

 public function __invoke($variables = null, $options = null, $template = null)
 {
     $viewModel = new JsonModel($variables, $options);
     if ($template) {
         $viewModel->setTemplate($template);
     }
     return $viewModel;
 }
开发者ID:Mendim,项目名称:ep3-bs,代码行数:8,代码来源:JsonViewModel.php

示例2: getjurisdictionproductformAction

 public function getjurisdictionproductformAction()
 {
     //$response = new \Zend\Http\Response();
     //$response->getHeaders()->addHeaderLine('Content-Type', 'text/xml; charset=utf-8');
     //$response->setContent($xml);
     $marketid = (int) $this->params()->fromQuery('marketid', 0);
     $marketproductId = (int) $this->params()->fromQuery('marketproductId', 0);
     $form = new \Zend\Form\Form();
     $marketJurisdictions = $this->getEntityManager()->getRepository('GDI\\Entity\\RMarketJurisdiction')->findByMarket($marketid);
     foreach ($marketJurisdictions as $key => $marketJurisdiction) {
         $jurisAbbr = $marketJurisdiction->getJurisdiction()->getJurisdictionAbbr();
         //$form->setHydrator(new DoctrineHydrator($this->getEntityManager(), 'GDI\Entity\TJurisdictionProduct'));
         $jurisdictionProduct = $this->getEntityManager()->getRepository('GDI\\Entity\\TJurisdictionProduct')->findOneBy(array('marketProduct' => $marketproductId, 'jurisdiction' => $marketJurisdiction->getJurisdiction()->getJurisdictionId()));
         //var_dump($jurisdictionProduct->getRSubmissionDate());
         //exit;
         //var_dump($jurisdictionProduct);
         //$form->bind($jurisdictionProduct);
         $form->setName('jurisdictionProduct');
         $form->add(array('type' => 'Zend\\Form\\Element\\Date', 'name' => "jurs_prod[{$jurisAbbr}][eSubmissionDate]", 'options' => array('label' => 'Submission (Estimated)'), 'attributes' => array('value' => is_null($jurisdictionProduct) ? "" : $jurisdictionProduct->getESubmissionDate(), 'class' => 'form-control')));
         $form->add(array('type' => 'Zend\\Form\\Element\\Date', 'name' => "jurs_prod[{$jurisAbbr}][eApprovalDate]", 'options' => array('label' => 'Approval (Estimated)'), 'attributes' => array('value' => is_null($jurisdictionProduct) ? "" : $jurisdictionProduct->getEApprovalDate(), 'class' => 'form-control')));
         $form->add(array('type' => 'Zend\\Form\\Element\\Date', 'name' => "jurs_prod[{$jurisAbbr}][eReleaseDate]", 'options' => array('label' => 'Master Release (Estimated)'), 'attributes' => array('value' => is_null($jurisdictionProduct) ? "" : $jurisdictionProduct->getEReleaseDate(), 'class' => 'form-control')));
         $form->add(array('type' => 'Zend\\Form\\Element\\Date', 'name' => "jurs_prod[{$jurisAbbr}][eLaunchDate]", 'options' => array('label' => 'Launch (Estimated)'), 'attributes' => array('value' => is_null($jurisdictionProduct) ? "" : $jurisdictionProduct->getELaunchDate(), 'class' => 'form-control')));
         $form->add(array('type' => 'Zend\\Form\\Element\\Date', 'name' => "jurs_prod[{$jurisAbbr}][eRegulatorDate]", 'options' => array('label' => 'Regulator (Estimated)'), 'attributes' => array('value' => is_null($jurisdictionProduct) ? "" : $jurisdictionProduct->getERegulatorDate(), 'class' => 'form-control')));
         // result
         $form->add(array('type' => 'Zend\\Form\\Element\\Date', 'name' => "jurs_prod[{$jurisAbbr}][rSubmissionDate]", 'options' => array('label' => 'Submission (Result)'), 'attributes' => array('value' => is_null($jurisdictionProduct) ? "" : $jurisdictionProduct->getRSubmissionDate(), 'class' => 'form-control')));
         $form->add(array('type' => 'Zend\\Form\\Element\\Date', 'name' => "jurs_prod[{$jurisAbbr}][rApprovalDate]", 'options' => array('label' => 'Approval (Result)'), 'attributes' => array('value' => is_null($jurisdictionProduct) ? "" : $jurisdictionProduct->getRApprovalDate(), 'class' => 'form-control')));
         $form->add(array('type' => 'Zend\\Form\\Element\\Date', 'name' => "jurs_prod[{$jurisAbbr}][rReleaseDate]", 'options' => array('label' => 'Master Release (Result)'), 'attributes' => array('value' => is_null($jurisdictionProduct) ? "" : $jurisdictionProduct->getRReleaseDate(), 'class' => 'form-control')));
         $form->add(array('type' => 'Zend\\Form\\Element\\Date', 'name' => "jurs_prod[{$jurisAbbr}][rLaunchDate]", 'options' => array('label' => 'Launch (Result)'), 'attributes' => array('value' => is_null($jurisdictionProduct) ? "" : $jurisdictionProduct->getRLaunchDate(), 'class' => 'form-control')));
         $form->add(array('type' => 'Zend\\Form\\Element\\Date', 'name' => "jurs_prod[{$jurisAbbr}][rRegulatorDate]", 'options' => array('label' => 'Regulator (Result)'), 'attributes' => array('value' => is_null($jurisdictionProduct) ? "" : $jurisdictionProduct->getRRegulatorDate(), 'class' => 'form-control')));
         /*if ($key>0) {
               var_dump($key);
               break;
           }*/
     }
     $request = $this->getRequest();
     if ($request->isPost()) {
         $form->setData($request->getPost());
         if ($form->isValid()) {
             //var_dump($product);
         }
     }
     $view = new JsonModel(array('form' => $form, 'marketJurisdictions' => $marketJurisdictions));
     //$view->setTemplate('Application/InputProductInformation/jurisdictionproductform.phtml'); // path to phtml file under view folder
     $view->setTemplate('GDI/Index2/jurisdictionproductform.phtml');
     // path to phtml file under view folder
     return $view;
 }
开发者ID:jonathan1212,项目名称:zend-tutorial,代码行数:47,代码来源:InputProductInformationController.php


注:本文中的Zend\View\Model\JsonModel::setTemplate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。