HTML_Template_PHPLIB
[ class tree: HTML_Template_PHPLIB ] [ index: HTML_Template_PHPLIB ] [ all elements ]

Class: HTML_Template_PHPLIB_Validator

Source Location: /HTML_Template_PHPLIB-1.4.0a1/HTML/Template/PHPLIB/Validator.php

Class Overview


Class to validate templates (syntax checks)


Author(s):

Methods


Inherited Variables

Inherited Methods


Class Details

[line 12]
Class to validate templates (syntax checks)


[ Top ]


Method Detail

checkBlockDefinitions   [line 62]

array checkBlockDefinitions( string $strContent)

Check if all block definitions have a closing counterpart and if the block comments have all the required spaces
  • Return: Array of errors/warnings. An error/warning is an array of several keys: message, line

Parameters:

string   $strContent   —  Template content

[ Top ]

intcmpLine   [line 198]

integer intcmpLine( array $arA, array $arB)

Compares the two error arrays by line number
  • Return: -1, 0 or 1 if $arA is smaller, equal or bigger than $arB

Parameters:

array   $arA   —  Error array one
array   $arB   —  Error array two

[ Top ]

sortByLine   [line 180]

void sortByLine( array &$arErrors)

Sorts the given error array by line numbers

Parameters:

array   &$arErrors   —  Error array

[ Top ]

validate   [line 33]

mixed validate( [string $strFile = null], [string $strContent = null])

Validates a template file.

You can pass either a file name, or the file content. One of the parameters needs to be !== null.

  • Return: Boolean true if no errors have been found, array of errors otherwise. An error is an array with keys
    • 'short' (short error code, string)
    • 'message' (readable message)
    • 'line' (line number)
    • 'code' (code that caused the error)
    false if no file and content is given
  • Public:

Parameters:

string   $strFile   —  Template file name to check
string   $strContent   —  Template content to check

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:10:07 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.