本文整理汇总了PHP中Cake\Core\App::shortName方法的典型用法代码示例。如果您正苦于以下问题:PHP App::shortName方法的具体用法?PHP App::shortName怎么用?PHP App::shortName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cake\Core\App
的用法示例。
在下文中一共展示了App::shortName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: webservice
/**
* Set or get a instance of a webservice
*
* @param string $name The name of the webservice
* @param \Muffin\Webservice\Webservice\WebserviceInterface|null $webservice The instance of the webservice you'd like to set
*
* @return $this
*/
public function webservice($name, WebserviceInterface $webservice = null)
{
if ($webservice !== null) {
$this->_webservices[$name] = $webservice;
return $this;
}
if (!isset($this->_webservices[$name])) {
list($pluginName) = pluginSplit(App::shortName(get_class($this), 'Webservice/Driver'));
$webserviceClass = implode('.', array_filter([$pluginName, Inflector::camelize($name)]));
$webservice = $this->_createWebservice($webserviceClass, ['endpoint' => $name, 'driver' => $this]);
$this->_webservices[$name] = $webservice;
}
return $this->_webservices[$name];
}
示例2: _getFieldTypeByFieldHandler
/**
* Get field type by field handler class name.
*
* @param object $handler Field handler instance
* @return string
*/
protected function _getFieldTypeByFieldHandler($handler)
{
list(, $type) = pluginSplit(App::shortName(get_class($handler), 'FieldHandlers', 'FieldHandler'));
return Inflector::underscore($type);
}
示例3: describe
/**
* {@inheritDoc}
*/
public function describe($endpoint)
{
$shortName = App::shortName(get_class($this), 'Webservice', 'Webservice');
list($plugin, $name) = pluginSplit($shortName);
$schemaShortName = implode('.', array_filter([$plugin, Inflector::classify($endpoint)]));
$schemaClassName = App::className($schemaShortName, 'Model/Endpoint/Schema', 'Schema');
if ($schemaClassName) {
return new $schemaClassName($endpoint);
}
throw new MissingEndpointSchemaException(['schema' => $schemaShortName, 'webservice' => $shortName]);
}