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.6.1/HTML/Template/PHPLIB/Validator.php

Class Overview


Class to validate templates (syntax checks)


Author(s):

Methods


Inherited Variables

Inherited Methods


Class Details

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


[ Top ]


Method Detail

checkBlockDefinitions   [line 71]

array checkBlockDefinitions( array $arLines)

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
  • Access: public

Parameters:

array   $arLines   —  Array of template code lines

[ Top ]

checkVariables   [line 249]

array checkVariables( array $arLines)

Checks if the variables defined are correct
  • Return: Array of error messages.
  • Access: public

Parameters:

array   $arLines   —  Array of template content lines

[ Top ]

intcmpLine   [line 326]

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
  • Access: public

Parameters:

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

[ Top ]

sortByLine   [line 308]

void sortByLine( &$arErrors, array $arErrors)

Sorts the given error array by line numbers
  • Access: public

Parameters:

array   $arErrors   —  Error array
   &$arErrors   — 

[ Top ]

validate   [line 43]

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
  • Access: public

Parameters:

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

[ Top ]


Documentation generated on Tue, 10 Dec 2019 05:16:07 -0500 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.