• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Zend_Tool_Project_Provider_View类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Zend_Tool_Project_Provider_View的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Tool_Project_Provider_View类的具体用法?PHP Zend_Tool_Project_Provider_View怎么用?PHP Zend_Tool_Project_Provider_View使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: _createAction

 function _createAction($actionName)
 {
     $response = $this->_registry->getResponse();
     $indexActionResource = Zend_Tool_Project_Provider_Action::createResource($this->_loadedProfile, $actionName, $this->_resourceName . 's', $this->_moduleName);
     $response->appendContent("Creating an {$actionName} action method in controller " . $this->_resourceName);
     $indexActionResource->create();
     $indexActionViewResource = Zend_Tool_Project_Provider_View::createResource($this->_loadedProfile, $actionName, $this->_resourceName . 's', $this->_moduleName);
     $response->appendContent("Creating a view script for the {$actionName} action method at " . $indexActionViewResource->getContext()->getPath());
     $indexActionViewResource->create();
 }
开发者ID:raphaeldealmeida,项目名称:Rph_Tools,代码行数:10,代码来源:Controller.php


示例2: create

 /**
  * Create a new controller
  *
  * @param string $name The name of the controller to create, in camelCase.
  * @param bool $indexActionIncluded Whether or not to create the index action.
  */
 public function create($name, $indexActionIncluded = true, $module = null)
 {
     $this->_loadProfile(self::NO_PROFILE_THROW_EXCEPTION);
     // determine if testing is enabled in the project
     require_once 'Zend/Tool/Project/Provider/Test.php';
     $testingEnabled = Zend_Tool_Project_Provider_Test::isTestingEnabled($this->_loadedProfile);
     if (self::hasResource($this->_loadedProfile, $name, $module)) {
         throw new Zend_Tool_Project_Provider_Exception('This project already has a controller named ' . $name);
     }
     // Check that there is not a dash or underscore, return if doesnt match regex
     if (preg_match('#[_-]#', $name)) {
         throw new Zend_Tool_Project_Provider_Exception('Controller names should be camel cased.');
     }
     $originalName = $name;
     $name = ucfirst($name);
     // get request & response
     $request = $this->_registry->getRequest();
     $response = $this->_registry->getResponse();
     try {
         $controllerResource = self::createResource($this->_loadedProfile, $name, $module);
         if ($indexActionIncluded) {
             $indexActionResource = Zend_Tool_Project_Provider_Action::createResource($this->_loadedProfile, 'index', $name, $module);
             $indexActionViewResource = Zend_Tool_Project_Provider_View::createResource($this->_loadedProfile, 'index', $name, $module);
         }
         if ($testingEnabled) {
             $testControllerResource = Zend_Tool_Project_Provider_Test::createApplicationResource($this->_loadedProfile, $name, 'index', $module);
         }
     } catch (Exception $e) {
         $response->setException($e);
         return;
     }
     // determime if we need to note to the user about the name
     if ($name !== $originalName) {
         $tense = $request->isPretend() ? 'would be' : 'is';
         $response->appendContent('Note: The canonical controller name that ' . $tense . ' used with other providers is "' . $name . '";' . ' not "' . $originalName . '" as supplied', array('color' => array('yellow')));
         unset($tense);
     }
     // do the creation
     if ($request->isPretend()) {
         $response->appendContent('Would create a controller at ' . $controllerResource->getContext()->getPath());
         if (isset($indexActionResource)) {
             $response->appendContent('Would create an index action method in controller ' . $name);
             $response->appendContent('Would create a view script for the index action method at ' . $indexActionViewResource->getContext()->getPath());
         }
         if ($testControllerResource) {
             $response->appendContent('Would create a controller test file at ' . $testControllerResource->getContext()->getPath());
         }
     } else {
         $response->appendContent('Creating a controller at ' . $controllerResource->getContext()->getPath());
         $controllerResource->create();
         if (isset($indexActionResource)) {
             $response->appendContent('Creating an index action method in controller ' . $name);
             $indexActionResource->create();
             $response->appendContent('Creating a view script for the index action method at ' . $indexActionViewResource->getContext()->getPath());
             $indexActionViewResource->create();
         }
         if ($testControllerResource) {
             $response->appendContent('Creating a controller test file at ' . $testControllerResource->getContext()->getPath());
             $testControllerResource->create();
         }
         $this->_storeProfile();
     }
 }
开发者ID:modulexcite,项目名称:zfopenid,代码行数:69,代码来源:Controller.php


示例3: create

 /**
  * create()
  *
  * @param string $name           Action name for controller, in camelCase format.
  * @param string $controllerName Controller name action should be applied to.
  * @param bool $viewIncluded     Whether the view should the view be included.
  * @param string $module         Module name action should be applied to.
  */
 public function create($name, $controllerName = 'Index', $viewIncluded = true, $module = null)
 {
     $this->_loadProfile();
     // get request/response object
     $request = $this->_registry->getRequest();
     $response = $this->_registry->getResponse();
     // determine if testing is enabled in the project
     require_once 'Zend/Tool/Project/Provider/Test.php';
     $testingEnabled = Zend_Tool_Project_Provider_Test::isTestingEnabled($this->_loadedProfile);
     if ($testingEnabled && !Zend_Tool_Project_Provider_Test::isPHPUnitAvailable()) {
         $testingEnabled = false;
         $response->appendContent('Note: PHPUnit is required in order to generate controller test stubs.', array('color' => array('yellow')));
     }
     // Check that there is not a dash or underscore, return if doesnt match regex
     if (preg_match('#[_-]#', $name)) {
         throw new Zend_Tool_Project_Provider_Exception('Action names should be camel cased.');
     }
     $originalName = $name;
     $originalControllerName = $controllerName;
     // ensure it is camelCase (lower first letter)
     $name = strtolower(substr($name, 0, 1)) . substr($name, 1);
     // ensure controller is MixedCase
     $controllerName = ucfirst($controllerName);
     if (self::hasResource($this->_loadedProfile, $name, $controllerName, $module)) {
         throw new Zend_Tool_Project_Provider_Exception('This controller (' . $controllerName . ') already has an action named (' . $name . ')');
     }
     $actionMethodResource = self::createResource($this->_loadedProfile, $name, $controllerName, $module);
     if ($testingEnabled) {
         $testActionMethodResource = Zend_Tool_Project_Provider_Test::createApplicationResource($this->_loadedProfile, $controllerName, $name, $module);
     }
     // alert the user about inline converted names
     $tense = $request->isPretend() ? 'would be' : 'is';
     if ($name !== $originalName) {
         $response->appendContent('Note: The canonical action name that ' . $tense . ' used with other providers is "' . $name . '";' . ' not "' . $originalName . '" as supplied', array('color' => array('yellow')));
     }
     if ($controllerName !== $originalControllerName) {
         $response->appendContent('Note: The canonical controller name that ' . $tense . ' used with other providers is "' . $controllerName . '";' . ' not "' . $originalControllerName . '" as supplied', array('color' => array('yellow')));
     }
     unset($tense);
     if ($request->isPretend()) {
         $response->appendContent('Would create an action named ' . $name . ' inside controller at ' . $actionMethodResource->getParentResource()->getContext()->getPath());
         if ($testActionMethodResource) {
             $response->appendContent('Would create an action test in ' . $testActionMethodResource->getParentResource()->getContext()->getPath());
         }
     } else {
         $response->appendContent('Creating an action named ' . $name . ' inside controller at ' . $actionMethodResource->getParentResource()->getContext()->getPath());
         $actionMethodResource->create();
         if ($testActionMethodResource) {
             $response->appendContent('Creating an action test in ' . $testActionMethodResource->getParentResource()->getContext()->getPath());
             $testActionMethodResource->create();
         }
         $this->_storeProfile();
     }
     if ($viewIncluded) {
         $viewResource = Zend_Tool_Project_Provider_View::createResource($this->_loadedProfile, $name, $controllerName, $module);
         if ($this->_registry->getRequest()->isPretend()) {
             $response->appendContent('Would create a view script for the ' . $name . ' action method at ' . $viewResource->getContext()->getPath());
         } else {
             $response->appendContent('Creating a view script for the ' . $name . ' action method at ' . $viewResource->getContext()->getPath());
             $viewResource->create();
             $this->_storeProfile();
         }
     }
 }
开发者ID:SandeepUmredkar,项目名称:PortalSMIP,代码行数:72,代码来源:Action.php


示例4: create

 /**
  * create()
  *
  * @param string $name
  * @param string $controllerName
  * @param bool $viewIncluded
  */
 public function create($name, $controllerName = 'index', $viewIncluded = true, $module = null)
 {
     $this->_loadProfile();
     if (self::hasResource($this->_loadedProfile, $name, $controllerName, $module)) {
         throw new Zend_Tool_Project_Provider_Exception('This controller (' . $controllerName . ') already has an action named (' . $name . ')');
     }
     $actionMethod = self::createResource($this->_loadedProfile, $name, $controllerName, $module);
     if ($this->_registry->getRequest()->isPretend()) {
         $this->_registry->getResponse()->appendContent('Would create an action named ' . $name . ' inside controller at ' . $actionMethod->getParentResource()->getContext()->getPath());
     } else {
         $this->_registry->getResponse()->appendContent('Creating an action named ' . $name . ' inside controller at ' . $actionMethod->getParentResource()->getContext()->getPath());
         $actionMethod->create();
         $this->_storeProfile();
     }
     if ($viewIncluded) {
         $viewResource = Zend_Tool_Project_Provider_View::createResource($this->_loadedProfile, $name, $controllerName, $module);
         if ($this->_registry->getRequest()->isPretend()) {
             $this->_registry->getResponse()->appendContent('Would create a view script for the ' . $name . ' action method at ' . $viewResource->getContext()->getPath());
         } else {
             $this->_registry->getResponse()->appendContent('Creating a view script for the ' . $name . ' action method at ' . $viewResource->getContext()->getPath());
             $viewResource->create();
             $this->_storeProfile();
         }
     }
 }
开发者ID:robeendey,项目名称:ce,代码行数:32,代码来源:Action.php


示例5: create

 /**
  * Enter description here...
  *
  * @param string $name The name of the controller to create.
  * @param bool $indexActionIncluded Whether or not to create the index action.
  */
 public function create($name, $indexActionIncluded = true, $module = null)
 {
     $this->_loadProfile(self::NO_PROFILE_THROW_EXCEPTION);
     // determine if testing is enabled in the project
     require_once 'Zend/Tool/Project/Provider/Test.php';
     $testingEnabled = Zend_Tool_Project_Provider_Test::isTestingEnabled($this->_loadedProfile);
     if (self::hasResource($this->_loadedProfile, $name, $module)) {
         throw new Zend_Tool_Project_Provider_Exception('This project already has a controller named ' . $name);
     }
     try {
         $controllerResource = self::createResource($this->_loadedProfile, $name, $module);
         if ($indexActionIncluded) {
             $indexActionResource = Zend_Tool_Project_Provider_Action::createResource($this->_loadedProfile, 'index', $name, $module);
             $indexActionViewResource = Zend_Tool_Project_Provider_View::createResource($this->_loadedProfile, 'index', $name, $module);
         }
         if ($testingEnabled) {
             $testControllerResource = Zend_Tool_Project_Provider_Test::createApplicationResource($this->_loadedProfile, $name, 'index', $module);
         }
     } catch (Exception $e) {
         $response = $this->_registry->getResponse();
         $response->setException($e);
         return;
     }
     // do the creation
     if ($this->_registry->getRequest()->isPretend()) {
         $this->_registry->getResponse()->appendContent('Would create a controller at ' . $controllerResource->getContext()->getPath());
         if (isset($indexActionResource)) {
             $this->_registry->getResponse()->appendContent('Would create an index action method in controller ' . $name);
             $this->_registry->getResponse()->appendContent('Would create a view script for the index action method at ' . $indexActionViewResource->getContext()->getPath());
         }
         if ($testControllerResource) {
             $this->_registry->getResponse()->appendContent('Would create a controller test file at ' . $testControllerResource->getContext()->getPath());
         }
     } else {
         $this->_registry->getResponse()->appendContent('Creating a controller at ' . $controllerResource->getContext()->getPath());
         $controllerResource->create();
         if (isset($indexActionResource)) {
             $this->_registry->getResponse()->appendContent('Creating an index action method in controller ' . $name);
             $indexActionResource->create();
             $this->_registry->getResponse()->appendContent('Creating a view script for the index action method at ' . $indexActionViewResource->getContext()->getPath());
             $indexActionViewResource->create();
         }
         if ($testControllerResource) {
             $this->_registry->getResponse()->appendContent('Creating a controller test file at ' . $testControllerResource->getContext()->getPath());
             $testControllerResource->create();
         }
         $this->_storeProfile();
     }
 }
开发者ID:VUW-SIM-FIS,项目名称:emiemi,代码行数:55,代码来源:Controller.php


示例6: create

 /**
  * create()
  *
  * @param string $name           Action name for controller, in camelCase format.
  * @param string $controllerName Controller name action should be applied to.
  * @param bool $viewIncluded     Whether the view should the view be included.
  * @param string $module         Module name action should be applied to.
  */
 public function create($name, $controllerName = 'index', $viewIncluded = true, $module = null)
 {
     $this->_loadProfile();
     if (self::hasResource($this->_loadedProfile, $name, $controllerName, $module)) {
         throw new Zend_Tool_Project_Provider_Exception('This controller (' . $controllerName . ') already has an action named (' . $name . ')');
     }
     // Check that there is not a dash or underscore, return if doesnt match regex
     if (preg_match('#[_-]#', $name)) {
         throw new Zend_Tool_Project_Provider_Exception('Action names should be camel cased.');
     }
     // ensure it is camelCase (lower first letter)
     $name = strtolower(substr($name, 0, 1)) . substr($name, 1);
     $actionMethod = self::createResource($this->_loadedProfile, $name, $controllerName, $module);
     if ($this->_registry->getRequest()->isPretend()) {
         $this->_registry->getResponse()->appendContent('Would create an action named ' . $name . ' inside controller at ' . $actionMethod->getParentResource()->getContext()->getPath());
     } else {
         $this->_registry->getResponse()->appendContent('Creating an action named ' . $name . ' inside controller at ' . $actionMethod->getParentResource()->getContext()->getPath());
         $actionMethod->create();
         $this->_storeProfile();
     }
     if ($viewIncluded) {
         $viewResource = Zend_Tool_Project_Provider_View::createResource($this->_loadedProfile, $name, $controllerName, $module);
         if ($this->_registry->getRequest()->isPretend()) {
             $this->_registry->getResponse()->appendContent('Would create a view script for the ' . $name . ' action method at ' . $viewResource->getContext()->getPath());
         } else {
             $this->_registry->getResponse()->appendContent('Creating a view script for the ' . $name . ' action method at ' . $viewResource->getContext()->getPath());
             $viewResource->create();
             $this->_storeProfile();
         }
     }
 }
开发者ID:crlang44,项目名称:frapi,代码行数:39,代码来源:Action.php


示例7: create

 /**
  * Updates views with scaffolded context
  *
  * @param Registry $registry
  * @param Profile  $profile
  * @param string   $name
  * @param string   $entity
  * @param string   $commaSeparatedFields
  * @param string   $module
  */
 public static function create(Registry $registry, Profile $profile, $name, $entity, $commaSeparatedFields, $module)
 {
     $view = new ViewSpecProvider();
     $pluralize = new Pluralize();
     $upperFirst = new UCFirst();
     $entityPlural = $upperFirst->filter($pluralize->filter($entity));
     $view->setRegistry($registry);
     $view->create($name, $entityPlural);
     $viewResource = ViewProvider::createResource($profile, $name, $entityPlural, $module);
     $path = $viewResource->getContext()->getPath();
     $getViewContentMethod = "_get{$name}ViewContent";
     file_put_contents($path, self::$getViewContentMethod($entity, self::_explodeFields($commaSeparatedFields)));
 }
开发者ID:phpspec,项目名称:phpspec-zend,代码行数:23,代码来源:ViewContent.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Zend_Translate类代码示例发布时间:2022-05-23
下一篇:
PHP Zend_Tool_Project_Provider_Test类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap