Moo\Template\Parser\Spaceless
Class Spaceless provides template tag to remove white spaces from around wrapped code.
Synopsis
class Spaceless
{
- // members
- protected static array $patternStart = ;
- protected static array $patternBetweenTag = ;
- protected static array $patternEnd = ;
- protected static array $patternOneSpace = ;
- protected static array $patternEmpty = ;
- // methods
- public static ?string spaceless()
- protected static void cleanCode()
- protected static void toStatementPerLine()
Members
protected
-
$patternBetweenTag
Remove space from between HTML tags. -
$patternEmpty
Remove space from empty statement `$val .= ' ';`. -
$patternEnd
Remove space from the end of the statement. -
$patternOneSpace
Convert multiple spaces into one space. -
$patternStart
Remove space from the start of the statement.
Methods
protected
- cleanCode() — Clean up a line of code based on its position `$index`.
- toStatementPerLine() — Convert the PHP string into an array of items. One statement per line.
public
- spaceless() — Remove white spaces from around template code.