FOF30\View\View::getName PHP Метод

getName() публичный Метод

The model name by default parsed using the classname, or it can be set by passing a $config['name'] in the class constructor
public getName ( ) : string
Результат string The name of the model
    public function getName()
    {
        if (empty($this->name)) {
            $r = null;
            if (!preg_match('/(.*)\\\\View\\\\(.*)\\\\(.*)/i', get_class($this), $r)) {
                throw new CannotGetName();
            }
            $this->name = $r[2];
        }
        return $this->name;
    }

Usage Example

Пример #1
0
 /**
  * A mocked object will have a random name, that won't match the regex expression in the parent.
  * To prevent exceptions, we have to manually set the name
  *
  * @return string
  */
 public function getName()
 {
     if (isset($this->methods['getName'])) {
         if ($this->methods['getName'] == 'parent') {
             return parent::getName();
         }
         $func = $this->methods['getName'];
         return call_user_func_array($func, array());
     }
     return $this->name;
 }
All Usage Examples Of FOF30\View\View::getName