src/Neuron/Core/Template.php
private static function getFilenames ($template, $all = false)
	{
		$out = array ();

		foreach (self::getPaths () as $v) {

			// Split prefix and folder
			$split = explode ('|', $v);

			if (count ($split) === 2)
			{
				$prefix = array_shift ($split);
				$folder = implode ('|', $split);
				$templatefixed = substr ($template, 0, strlen ($prefix));

				if ($templatefixed == $prefix)
				{
					$templaterest = substr ($template, strlen ($templatefixed));
					if (is_readable ($folder . $templaterest))
					{
						$out[] = $folder . $templaterest;

						if (!$all)
							return $out;
					}
				}
			}
			else
			{
				if (is_readable ($v . $template))
				{
					$out[] = $v . $template;

					if (!$all)
						return $out;
				}
			}
		}

		if (count ($out) > 0)
		{
			return $out;
		}
		return false;	
	}
private static function getFilenames ($template, $all = false)
	{
		$out = array ();

		foreach (self::getPaths () as $v) {

			// Split prefix and folder
			$split = explode ('|', $v);

			if (count ($split) === 2)
			{
				$prefix = array_shift ($split);
				$folder = implode ('|', $split);
				$templatefixed = substr ($template, 0, strlen ($prefix));

				if ($templatefixed == $prefix)
				{
					$templaterest = substr ($template, strlen ($templatefixed));
					if (is_readable ($folder . $templaterest))
					{
						$out[] = $folder . $templaterest;

						if (!$all)
							return $out;
					}
				}
			}
			else
			{
				if (is_readable ($v . $template))
				{
					$out[] = $v . $template;

					if (!$all)
						return $out;
				}
			}
		}

		if (count ($out) > 0)
		{
			return $out;
		}
		return false;	
	}
private static function getFilenames ( $ template , $ all = false ) { $ out = array ( ) ; foreach ( self :: getPaths ( ) as $ v ) { // Split prefix and folder $ split = explode ( '|' , $ v ) ; if ( count ( $ split ) === 2 ) { $ prefix = array_shift ( $ split ) ; $ folder = implode ( '|' , $ split ) ; $ templatefixed = substr ( $ template , 0 , strlen ( $ prefix ) ) ; if ( $ templatefixed == $ prefix ) { $ templaterest = substr ( $ template , strlen ( $ templatefixed ) ) ; if ( is_readable ( $ folder . $ templaterest ) ) { $ out [ ] = $ folder . $ templaterest ; if ( ! $ all ) return $ out ; } } } else { if ( is_readable ( $ v . $ template ) ) { $ out [ ] = $ v . $ template ; if ( ! $ all ) return $ out ; } } } if ( count ( $ out ) > 0 ) { return $ out ; } return false ; }
Return an array of all filenames, or FALSE if none are found.
@param $template
@param bool $all
@return bool|string
Return an array of all filenames or FALSE if none are found .