Amiro.CMS API Reference
Amiro.Ru / Manual
Loading search...

The AMI_iTemplate interface

• Introduction

Template parser class interface.

• Interface synopsis

AMI_iTemplate {
/* Constants */
// Hypermodule/configuration locale path part.
const AMI_iTemplate::LNG_HYPER_PATH =  'templates/lang/hyper';
// Module locale path part.
const AMI_iTemplate::LNG_MOD_PATH =  'templates/lang/modules';
// Common locale path part.
const AMI_iTemplate::LNG_PATH =  'templates/lang';
// Module options local locale path part.
const AMI_iTemplate::LOCAL_LNG_MOD_OPT_PATH =  '_local/_admin/templates/lang/options';
// Module local locale path part.
const AMI_iTemplate::LOCAL_LNG_MOD_PATH =  '_local/_admin/templates/lang/modules';
// Module local locale path part.
const AMI_iTemplate::LOCAL_LNG_PATH =  '_local/_admin/templates/lang';
// Module local template path part.
const AMI_iTemplate::LOCAL_TPL_MOD_PATH =  '_local/_admin/templates/modules';
// Module local template path part.
const AMI_iTemplate::LOCAL_TPL_PATH =  '_local/_admin/templates';
// Hypermodule/configuration template path part.
const AMI_iTemplate::TPL_HYPER_PATH =  'templates/hyper';
// Module template path part.
const AMI_iTemplate::TPL_MOD_PATH =  'templates/modules';
// Common template path part.
const AMI_iTemplate::TPL_PATH =  'templates';
/* Methods */
// Adds block.
public addBlock ( string $name, string $path, [ bool $override = FALSE ] ) returns void;
// Drops block.
public dropBlock ( string $name ) returns void;
// Returns block locale.
public getBlockLocale ( string $name ) returns array;
// Returns true if block set is set.
public issetSet ( string $name ) returns bool;
// Merges block to the existing block.
public mergeBlock ( string $name, string $path ) returns void;
// Parses block set.
public parse ( string $name, [ $aScope = array() ] ) returns string;
// Parses locale and return array having locale names as keys and its values as values.
public parseLocale ( string $path, [ string $locale = 'auto' ], [ bool $override = FALSE ] ) returns array;
// Parses string.
public parseString ( string $string, [ $aScope = array() ] ) returns string;
// Sets block locale.
public setBlockLocale ( string $name, $aLocale, [ bool $doAppend = false ] ) returns void;
// Sets current template locale.
public setLocale ( string $locale ) returns void;
}
Tags:
since 5.10.0

• Interface Constants

LNG_HYPER_PATH

Hypermodule/configuration locale path part.

Templates/locales path part.

LNG_MOD_PATH

Module locale path part.

Templates/locales path part.

LNG_PATH

Common locale path part.

Templates/locales path part.

LOCAL_LNG_MOD_OPT_PATH

Module options local locale path part.

Templates/locales path part.

LOCAL_LNG_MOD_PATH

Module local locale path part.

Templates/locales path part.

LOCAL_LNG_PATH

Module local locale path part.

Templates/locales path part.

LOCAL_TPL_MOD_PATH

Module local template path part.

Templates/locales path part.

LOCAL_TPL_PATH

Module local template path part.

Templates/locales path part.

TPL_HYPER_PATH

Hypermodule/configuration template path part.

Templates/locales path part.

TPL_MOD_PATH

Module template path part.

Templates/locales path part.

TPL_PATH

Common template path part.

Templates/locales path part.

• Interface Methods

// Adds block.
public addBlock ( string $name, string $path, [ bool $override = FALSE ] ) returns void;
  • string $name
    Internal block name
  • string $path
    Template path
  • bool $override
    Flag specifying to override existing loaded block
// Drops block.
public dropBlock ( string $name ) returns void;
  • string $name
    Internal block name
// Returns block locale.
public getBlockLocale ( string $name ) returns array;
  • string $name
    Block name
Tags:
since 5.14.0
// Returns true if block set is set.
public issetSet ( string $name ) returns bool;
  • string $name
    Set name in format "{$name}:{$setName}"
// Merges block to the existing block.
public mergeBlock ( string $name, string $path ) returns void;
  • string $name
    Internal block name
  • string $path
    Template path
Tags:
since 5.12.4
// Parses block set.
public parse ( string $name, [ $aScope = array() ] ) returns string;
  • string $name
    Set name in format "{$blockName}:{$setName}"
  • array $aScope
    Scope
// Parses locale and return array having locale names as keys and its values as values.
public parseLocale ( string $path, [ string $locale = 'auto' ], [ bool $override = FALSE ] ) returns array;
  • string $path
    Locales path
  • string $locale
    Locale for data in locale file. Use 'auto' for current locale.
  • bool $override
    Flag specifying to override existing loaded locale
// Parses string.
public parseString ( string $string, [ $aScope = array() ] ) returns string;
  • string $string
    String to parse
  • array $aScope
    Scope
// Sets block locale.
public setBlockLocale ( string $name, $aLocale, [ bool $doAppend = false ] ) returns void;
  • string $name
    Block name
  • array $aLocale
    Array of locale data as language_variable => translation
  • bool $doAppend
    Append locale to existing one
// Sets current template locale.
public setLocale ( string $locale ) returns void;
  • string $locale
    New locale name