public function getLabel() {
        if ($this->label) {
            return $this->translate($this->label);
        }
        $labels = array();
        if ($this->form->model && is_string($this->form->model)) {
            $class = $this->form->model;
            $labels = $class::getLabels();
        } elseif ($this->form->model && is_object($this->form->model)) {
            $class = get_class($this->form->model);
            $labels = $class::getLabels();
        }
        if (isset($labels[$this->name])) {
            return $this->translate($labels[$this->name]);
        }
        return $this->translate(ucwords(str_replace('_', ' ', $this->name)));
    }
public function getLabel() {
        if ($this->label) {
            return $this->translate($this->label);
        }
        $labels = array();
        if ($this->form->model && is_string($this->form->model)) {
            $class = $this->form->model;
            $labels = $class::getLabels();
        } elseif ($this->form->model && is_object($this->form->model)) {
            $class = get_class($this->form->model);
            $labels = $class::getLabels();
        }
        if (isset($labels[$this->name])) {
            return $this->translate($labels[$this->name]);
        }
        return $this->translate(ucwords(str_replace('_', ' ', $this->name)));
    }
public function getLabel ( ) { if ( $ this -> label ) { return $ this -> translate ( $ this -> label ) ; } $ labels = array ( ) ; if ( $ this -> form -> model && is_string ( $ this -> form -> model ) ) { $ class = $ this -> form -> model ; $ labels = $ class :: getLabels ( ) ; } elseif ( $ this -> form -> model && is_object ( $ this -> form -> model ) ) { $ class = get_class ( $ this -> form -> model ) ; $ labels = $ class :: getLabels ( ) ; } if ( isset ( $ labels [ $ this -> name ] ) ) { return $ this -> translate ( $ labels [ $ this -> name ] ) ; } return $ this -> translate ( ucwords ( str_replace ( '_' , ' ' , $ this -> name ) ) ) ; }
Get label for current field. It will first try to get label attribute, if that's not specified it will check for a model
and read the label from there, if it's still not found then it will generate one using the name.
@return string
Get label for current field . It will first try to get label attribute if that s not specified it will check for a model and read the label from there if it s still not found then it will generate one using the name .