本文整理汇总了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;
}