original_string: protected function _getLayoutFileName($name = null)
      {
          if ($name === null) {
              $name = $this->layout;
          }
          $subDir = null;
  
          if ($this->layoutPath) {
              $subDir = $this->layoutPath . DIRECTORY_SEPARATOR;
          }
          list($plugin, $name) = $this->pluginSplit($name);
  
          $layoutPaths = $this->_getSubPaths('Layout' . DIRECTORY_SEPARATOR . $subDir);
  
          foreach ($this->_paths($plugin) as $path) {
              foreach ($layoutPaths as $layoutPath) {
                  $currentPath = $path . $layoutPath;
                  if (file_exists($currentPath . $name . $this->_ext)) {
                      return $this->_checkFilePath($currentPath . $name . $this->_ext, $currentPath);
                  }
              }
          }
          throw new MissingLayoutException([
              'file' => $layoutPaths[0] . $name . $this->_ext
          ]);
      }
code: protected function _getLayoutFileName($name = null)
      {
          if ($name === null) {
              $name = $this->layout;
          }
          $subDir = null;
  
          if ($this->layoutPath) {
              $subDir = $this->layoutPath . DIRECTORY_SEPARATOR;
          }
          list($plugin, $name) = $this->pluginSplit($name);
  
          $layoutPaths = $this->_getSubPaths('Layout' . DIRECTORY_SEPARATOR . $subDir);
  
          foreach ($this->_paths($plugin) as $path) {
              foreach ($layoutPaths as $layoutPath) {
                  $currentPath = $path . $layoutPath;
                  if (file_exists($currentPath . $name . $this->_ext)) {
                      return $this->_checkFilePath($currentPath . $name . $this->_ext, $currentPath);
                  }
              }
          }
          throw new MissingLayoutException([
              'file' => $layoutPaths[0] . $name . $this->_ext
          ]);
      }
code_tokens: protected function _getLayoutFileName ( $ name = null ) { if ( $ name === null ) { $ name = $ this -> layout ; } $ subDir = null ; if ( $ this -> layoutPath ) { $ subDir = $ this -> layoutPath . DIRECTORY_SEPARATOR ; } list ( $ plugin , $ name ) = $ this -> pluginSplit ( $ name ) ; $ layoutPaths = $ this -> _getSubPaths ( 'Layout' . DIRECTORY_SEPARATOR . $ subDir ) ; foreach ( $ this -> _paths ( $ plugin ) as $ path ) { foreach ( $ layoutPaths as $ layoutPath ) { $ currentPath = $ path . $ layoutPath ; if ( file_exists ( $ currentPath . $ name . $ this -> _ext ) ) { return $ this -> _checkFilePath ( $ currentPath . $ name . $ this -> _ext , $ currentPath ) ; } } } throw new MissingLayoutException ( [ 'file' => $ layoutPaths [ 0 ] . $ name . $ this -> _ext ] ) ; }
docstring: Returns layout filename for this template as a string.
  
  @param string|null $name The name of the layout to find.
  @return string Filename for layout file (.ctp).
  @throws \Cake\View\Exception\MissingLayoutException when a layout cannot be located
docstring_tokens: Returns layout filename for this template as a string .