libraries/MVC/BView.php
public function templateLoad($subName = '', $absolute = false) {
		$this->addPathes();
		$suffix = BBrowserUseragent::getDeviceSuffix();
		//
		if ($absolute) {
			$fNames = array($subName . $suffix . '.php', $subName . '.d.php');
		} else {
			if (!empty($subName)) {
				$subName = '.' . $subName;
			}
			$fNames = array($this->componentname . '.' . $this->viewname . $subName . $suffix . '.php', $this->componentname . '.' . $this->viewname . $subName . '.d.php', $this->componentname . '.' . $this->viewname . $suffix . '.php', $this->componentname . '.' . $this->viewname . '.d.php');
		}
		$filename = '';
		$subfname = '';
		foreach ($this->paths as $fp) {
			if (!empty($filename)) {
				break;
			}
			foreach ($fNames as $fn) {
				if (DEBUG_MODE) {
					BLog::addToLog('[View] try to load template:' . $fp . $fn);
				}
				if (file_exists($fp . $fn)) {
					$filename = $fp . $fn;
					$subfname = $fn;
					break;
				}
			}
		}
		if (empty($filename)) {
			return '';
		}
		//Rendering template file into string...
		ob_start();
		include $filename;
		$html = ob_get_clean();
		if (DEBUG_MODE) {
			$tp = \Brilliant\HTTP\BRequest::GetInt('tp');
			if ($tp) {
				$html = '<div style="font-size: 10px; color: #ccc;">' . $subfname . '</div>' . $html;
			}
		}
		return $html;
	}
public function templateLoad($subName = '', $absolute = false) {
		$this->addPathes();
		$suffix = BBrowserUseragent::getDeviceSuffix();
		//
		if ($absolute) {
			$fNames = array($subName . $suffix . '.php', $subName . '.d.php');
		} else {
			if (!empty($subName)) {
				$subName = '.' . $subName;
			}
			$fNames = array($this->componentname . '.' . $this->viewname . $subName . $suffix . '.php', $this->componentname . '.' . $this->viewname . $subName . '.d.php', $this->componentname . '.' . $this->viewname . $suffix . '.php', $this->componentname . '.' . $this->viewname . '.d.php');
		}
		$filename = '';
		$subfname = '';
		foreach ($this->paths as $fp) {
			if (!empty($filename)) {
				break;
			}
			foreach ($fNames as $fn) {
				if (DEBUG_MODE) {
					BLog::addToLog('[View] try to load template:' . $fp . $fn);
				}
				if (file_exists($fp . $fn)) {
					$filename = $fp . $fn;
					$subfname = $fn;
					break;
				}
			}
		}
		if (empty($filename)) {
			return '';
		}
		//Rendering template file into string...
		ob_start();
		include $filename;
		$html = ob_get_clean();
		if (DEBUG_MODE) {
			$tp = \Brilliant\HTTP\BRequest::GetInt('tp');
			if ($tp) {
				$html = '<div style="font-size: 10px; color: #ccc;">' . $subfname . '</div>' . $html;
			}
		}
		return $html;
	}
public function templateLoad ( $ subName = '' , $ absolute = false ) { $ this -> addPathes ( ) ; $ suffix = BBrowserUseragent :: getDeviceSuffix ( ) ; // if ( $ absolute ) { $ fNames = array ( $ subName . $ suffix . '.php' , $ subName . '.d.php' ) ; } else { if ( ! empty ( $ subName ) ) { $ subName = '.' . $ subName ; } $ fNames = array ( $ this -> componentname . '.' . $ this -> viewname . $ subName . $ suffix . '.php' , $ this -> componentname . '.' . $ this -> viewname . $ subName . '.d.php' , $ this -> componentname . '.' . $ this -> viewname . $ suffix . '.php' , $ this -> componentname . '.' . $ this -> viewname . '.d.php' ) ; } $ filename = '' ; $ subfname = '' ; foreach ( $ this -> paths as $ fp ) { if ( ! empty ( $ filename ) ) { break ; } foreach ( $ fNames as $ fn ) { if ( DEBUG_MODE ) { BLog :: addToLog ( '[View] try to load template:' . $ fp . $ fn ) ; } if ( file_exists ( $ fp . $ fn ) ) { $ filename = $ fp . $ fn ; $ subfname = $ fn ; break ; } } } if ( empty ( $ filename ) ) { return '' ; } //Rendering template file into string... ob_start ( ) ; include $ filename ; $ html = ob_get_clean ( ) ; if ( DEBUG_MODE ) { $ tp = \ Brilliant \ HTTP \ BRequest :: GetInt ( 'tp' ) ; if ( $ tp ) { $ html = '<div style="font-size: 10px; color: #ccc;">' . $ subfname . '</div>' . $ html ; } } return $ html ; }
Rendering layout into string

@param string $subName sub name, if absolute or template name ('users.login') if not.
@param bool $absolute true means absolute name
@return string
Rendering layout into string