本文整理汇总了PHP中Zend_Form_Element_Xhtml::addPrefixPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Xhtml::addPrefixPath方法的具体用法?PHP Zend_Form_Element_Xhtml::addPrefixPath怎么用?PHP Zend_Form_Element_Xhtml::addPrefixPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form_Element_Xhtml
的用法示例。
在下文中一共展示了Zend_Form_Element_Xhtml::addPrefixPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addPrefixPath
/**
* Add prefix path for plugin loader for captcha adapters
*
* This method handles the captcha type, the rest is handled by
* the parent
* @param string $prefix
* @param string $path
* @param string $type
* @return Zend_Form_Element
* @see Zend_Form_Element::addPrefixPath
*/
public function addPrefixPath($prefix, $path, $type = null)
{
$type = strtoupper($type);
switch ($type) {
case null:
$loader = $this->getPluginLoader(self::CAPTCHA);
$nsSeparator = false !== strpos($prefix, '\\') ? '\\' : '_';
$cPrefix = rtrim($prefix, $nsSeparator) . $nsSeparator . 'Captcha';
$cPath = rtrim($path, '/\\') . '/Captcha';
$loader->addPrefixPath($cPrefix, $cPath);
return parent::addPrefixPath($prefix, $path);
case self::CAPTCHA:
$loader = $this->getPluginLoader($type);
$loader->addPrefixPath($prefix, $path);
return $this;
default:
return parent::addPrefixPath($prefix, $path, $type);
}
}
示例2: addPrefixPath
/**
* Add prefix path for plugin loader
*
* @param string $prefix
* @param string $path
* @param string $type
* @return Zend_Form_Element_File
*/
public function addPrefixPath($prefix, $path, $type = null)
{
$type = strtoupper($type);
if (!empty($type) && $type != self::TRANSFER_ADAPTER) {
return parent::addPrefixPath($prefix, $path, $type);
}
if (empty($type)) {
$pluginPrefix = rtrim($prefix, '_') . '_Transfer_Adapter';
$pluginPath = rtrim($path, DIRECTORY_SEPARATOR) . '/Transfer/Adapter/';
$loader = $this->getPluginLoader(self::TRANSFER_ADAPTER);
$loader->addPrefixPath($pluginPrefix, $pluginPath);
return parent::addPrefixPath($prefix, $path, null);
}
$loader = $this->getPluginLoader($type);
$loader->addPrefixPath($prefix, $path);
return $this;
}