src/class-factory.php
protected function extension( $view ) {
		$extensions = $this->extensions();

		// Return if a valid extension exists in the template string.
		$ext_reg = '/(' . implode( '|', $extensions ) . ')+$/';
		if ( preg_match( $ext_reg, $view ) ) {
			return $template;
		}

		// Add extension to template string if it don't exists.
		return substr( $view, -strlen( $extensions[0] ) ) === $extensions[0]
			? $view : $view . $extensions[0];
	}
protected function extension( $view ) {
		$extensions = $this->extensions();

		// Return if a valid extension exists in the template string.
		$ext_reg = '/(' . implode( '|', $extensions ) . ')+$/';
		if ( preg_match( $ext_reg, $view ) ) {
			return $template;
		}

		// Add extension to template string if it don't exists.
		return substr( $view, -strlen( $extensions[0] ) ) === $extensions[0]
			? $view : $view . $extensions[0];
	}
protected function extension ( $ view ) { $ extensions = $ this -> extensions ( ) ; // Return if a valid extension exists in the template string. $ ext_reg = '/(' . implode ( '|' , $ extensions ) . ')+$/' ; if ( preg_match ( $ ext_reg , $ view ) ) { return $ template ; } // Add extension to template string if it don't exists. return substr ( $ view , - strlen ( $ extensions [ 0 ] ) ) === $ extensions [ 0 ] ? $ view : $ view . $ extensions [ 0 ] ; }
Add extension to the view string if it don't exists.

@param  string $view

@return string
Add extension to the view string if it don t exists .