當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Resource::name方法代碼示例

本文整理匯總了PHP中Resource::name方法的典型用法代碼示例。如果您正苦於以下問題:PHP Resource::name方法的具體用法?PHP Resource::name怎麽用?PHP Resource::name使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Resource的用法示例。


在下文中一共展示了Resource::name方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: normalCases

 /**
  * @test
  */
 public function normalCases()
 {
     $this->assertEquals('something id', $this->subject->description());
     $this->assertEquals('sampleId', $this->subject->name());
     $this->assertEquals('string', $this->subject->type());
     $this->assertEquals('path', $this->subject->paramType());
 }
開發者ID:gong023,項目名稱:swagger-assert,代碼行數:10,代碼來源:ParameterTest.php

示例2: set

 /**
  * Set routes and nested resources based on the models
  *
  * @param string|arrau $model the name of the resource or an array of names
  * @param array $options array of options - see the usage description
  * @param string $parent the name of the parent route
  */
 public static function set($name, array $options = array(), $parent = NULL)
 {
     if (Arr::is_array($name)) {
         $resources = array();
         foreach ($name as $resource_name) {
             $resources[] = Resource::set($resource_name, $options, $parent);
         }
         return $resources;
     }
     $resource = new Resource($name, $options, $parent);
     return Resource::$_resources[$resource->name()] = $resource;
 }
開發者ID:openbuildings,項目名稱:jam-resource,代碼行數:19,代碼來源:Resource.php

示例3: _resource

 private function _resource(Resource $resource)
 {
     $resource_string = "\n" . Minion_CLI::color(' ' . $resource->name(), 'green');
     if ($this->_options['actions'] !== FALSE) {
         $resource_string .= $this->_resource_actions($resource);
     } elseif ($this->_options['uris'] !== FALSE) {
         $resource_string .= $this->_resource_uris($resource);
     }
     foreach ($resource->children() as $child_resource_name) {
         $resource_string .= "\n" . '   ' . Minion_CLI::color(substr($child_resource_name, strlen($resource->name()) + 1), 'cyan');
         if ($this->_options['actions'] !== FALSE) {
             $resource_string .= $this->_resource_actions(Resource::get($child_resource_name), '  ');
         } elseif ($this->_options['uris'] !== FALSE) {
             $resource_string .= $this->_resource_uris(Resource::get($child_resource_name), '  ');
         }
     }
     $resource_string .= "\n";
     return $resource_string;
 }
開發者ID:openbuildings,項目名稱:jam-resource,代碼行數:19,代碼來源:Index.php


注:本文中的Resource::name方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。