本文整理汇总了PHP中Zend_View::__call方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_View::__call方法的具体用法?PHP Zend_View::__call怎么用?PHP Zend_View::__call使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_View
的用法示例。
在下文中一共展示了Zend_View::__call方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __call
public function __call($name, $args)
{
if (!preg_match('/^get/', $name)) {
return parent::__call($name, $args);
}
$property = preg_replace('/^get/', '', $name);
$first = mb_convert_case(mb_substr($property, 0, 1), MB_CASE_LOWER);
$property = '_' . preg_replace('/^./', $first, $property);
return isset($this->{$property}) ? $this->{$property} : parent::__call($name, $args);
}
示例2: __call
public function __call($method, $args)
{
$accessor = substr($method, 0, 3);
$magicKeys = array('set', 'get', 'uns', 'has');
if (in_array($accessor, $magicKeys)) {
$key = Core_Model_Lib_String::camelize(substr($method, 3));
$method = $accessor . 'Data';
$value = isset($args[0]) ? $args[0] : null;
return call_user_func(array($this, $method), $key, $value);
}
return parent::__call($method, $args);
}
示例3: __call
/**
* @param string $method
* @param array $arguments
* @return mixed|Model\Document\Tag|string
* @throws \Exception
*/
public function __call($method, $arguments)
{
$class = "\\Pimcore\\Model\\Document\\Tag\\" . ucfirst(strtolower($method));
$classFound = true;
if (!\Pimcore\Tool::classExists($class)) {
$oldStyleClass = "Document_Tag_" . ucfirst(strtolower($method));
if (!\Pimcore\Tool::classExists($oldStyleClass)) {
$classFound = false;
}
}
if ($classFound) {
if (!isset($arguments[0])) {
throw new \Exception("You have to set a name for the called tag (editable): " . $method);
}
// set default if there is no editable configuration provided
if (!isset($arguments[1])) {
$arguments[1] = array();
}
return $this->tag($method, $arguments[0], $arguments[1]);
}
if ($this->document instanceof Model\Document) {
if (method_exists($this->document, $method)) {
return call_user_func_array(array($this->document, $method), $arguments);
}
}
return parent::__call($method, $arguments);
}
示例4: __call
/**
* @throws Exception
* @param $method
* @param $arguments
* @return mixed|string|Tag
*/
public function __call($method, $arguments)
{
$class = "Document_Tag_" . ucfirst(strtolower($method));
$tagFile = str_replace("_", "/", $class) . ".php";
if (Pimcore_File::isIncludeable($tagFile)) {
include_once $tagFile;
if (@Pimcore_Tool::classExists($class)) {
if (!isset($arguments[0])) {
throw new Exception("You have to set a name for the called tag (editable): " . $method);
}
// set default if there is no editable configuration provided
if (!isset($arguments[1])) {
$arguments[1] = array();
}
return $this->tag($method, $arguments[0], $arguments[1]);
}
}
if ($this->document instanceof Document) {
if (method_exists($this->document, $method)) {
return call_user_func_array(array($this->document, $method), $arguments);
}
}
return parent::__call($method, $arguments);
}