Sponsored Link

config

Opening the [OnePlate.php] in the editor, and customize the settings.

Customizing the constant in the class

There is no need to change these. It is possible to change.


const TPL_TAG_START = '{{';
const TPL_TAG_END = '}}';

Start and end of a tag that describes the template. You can change to such as '{%', '%}' or '<%', '%>'.


const TPL_COM_START = '{*';
const TPL_COM_END = '*}';

Start and end of the template of the comments. Not the HTML comments, is the template for comments.


const TPL_VAR_NAME = '$myTplVars';

Variable to be assigned to the template. It must not overlap with other variable name.


const TPL_TAG_HEAD = '@';

Header of template tag.


const TPL_LITERAL = '!';

Characters to describe the literal. Described before and after the 'TPL_TAG_START / TPL_TAG_END'.


const ESCAPE_DELIMITER = '|';

Delimiter of escape list.


const ARRAY_DELIMITER = '.';

Delimiter of array dimension.


const FOREACH_KEY = '@index';
const FOREACH_KEY = '@key';
const FOREACH_VAL = '@val';

String that indicates the index and key and value in the foreach.


const HTML_ENCODING = 'UTF-8';

htmlspecialchars encoding.


Customizing the initial value of property in the class

These parameters can be changed as a property at the time of instance generation and class.


'BENCHMARK_FLG' : TRUE | FALSE

Calculate the processing time on/off.


'TPL_DIR'

Directory name of the template file.


'DELETE_HTML_COM' : TRUE | FALSE

Delete html comment (<!--...-->) from the HTML source. It is also deleted the source of the css and js that are enclosed in HTML comments.


'DELETE_TAB' : TRUE | FALSE

Delete Tab ( ) from the HTML source.


'DELETE_RET' : TRUE | FALSE

Delete Return (
) from the HTML source.


'DELETE_PHP_TAG' : TRUE | FALSE

Delete the PHP tag (<? ... ?>) contained in the template


'CACHE_FLG' : TRUE | FALSE

Enable the cache.


'CACHE_DIR'

Directory name of the cache file.


'CACHE_DIR_PERMISSION'

Directory permissions of the cache file.


'CACHE_PREFIX'

Prefix of the cache file.


'CACHE_EXT'

Extension of the cache file.


'CACHE_PERMISSION'

Permissions of the cache file.


'CACHE_NAME_DELM'

Delimiter of the cache file name. (File name : CACHE_PREFIX#script_name#TPL_DIR#tpl_name#CACHE_EXT)


'CACHE_LIFETIME'

Validity period of the cache file [sec]. If the cache is older than this will be regenerated.


'CACHE_CLEAN'

Time to delete the old cache files [sec]. If the cache is older than this will be removed in the destructor. In the case of 0 does not remove.


'DEFAULT_HTML_ESCAPE' : TRUE | FALSE

To HTML escaped (htmlspecialchars) by default.


'FOREACH_INDEX_FROM'

Start value of foreach index.


By setting the parameters when creating an instance, you can override the value of the properties of the class.

$op_conf = array('BENCHMARK_FLG'=>TRUE, 'CACHE_FLG'=>TRUE);
$op = new OnePlate($op_conf);

Or, after the generation of the instance, you can change the value of the properties of the class.

$op->conf['BENCHMARK_FLG'] = FALSE;
$op->conf['CACHE_FLG'] = FALSE;