本文整理匯總了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());
}
示例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;
}
示例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;
}