original_string: public function addLayout($name)
      {
          if (!$this->template) {
              return;
          }
          // TODO: change to functionExists()
          if (method_exists($this, $lfunc = 'layout_'.$name)) {
              if ($this->template->is_set($name)) {
                  $this->$lfunc();
              }
          }
  
          return $this;
      }
code: public function addLayout($name)
      {
          if (!$this->template) {
              return;
          }
          // TODO: change to functionExists()
          if (method_exists($this, $lfunc = 'layout_'.$name)) {
              if ($this->template->is_set($name)) {
                  $this->$lfunc();
              }
          }
  
          return $this;
      }
code_tokens: public function addLayout ( $ name ) { if ( ! $ this -> template ) { return ; } // TODO: change to functionExists() if ( method_exists ( $ this , $ lfunc = 'layout_' . $ name ) ) { if ( $ this -> template -> is_set ( $ name ) ) { $ this -> $ lfunc ( ) ; } } return $ this ; }
docstring: Register new layout, which, if has method and tag in the template, will be rendered.
  
  @param string $name
  
  @return $this
docstring_tokens: Register new layout which if has method and tag in the template will be rendered .