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

The AMI_Template class

• Introduction

Template parser lite class that works with disk templates only.

• Class synopsis

AMI_Template implements AMI_iTemplate {
/* 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;
}

• Class 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

Implementation of: AMI_iTemplate::addBlock().

AMI_iTemplate interface implementation
// Drops block.
public dropBlock ( string $name ) returns void;
  • string $name
    Internal block name

Implementation of: AMI_iTemplate::dropBlock().

AMI_iTemplate interface implementation
// Returns block locale.
public getBlockLocale ( string $name ) returns array;
  • string $name
    Block name

Implementation of: AMI_iTemplate::getBlockLocale().

AMI_iTemplate interface implementation
Tags:
since 5.14.0
// Returns true if block set is set.
public issetSet ( string $name ) returns bool;
  • string $name
    Set name in format "{$blockName}:{$setName}"

Implementation of: AMI_iTemplate::issetSet().

AMI_iTemplate interface implementation
// Merges block to the existing block.
public mergeBlock ( string $name, string $path ) returns void;
  • string $name
    Internal block name
  • string $path
    Template path

Implementation of: AMI_iTemplate::mergeBlock().

AMI_iTemplate interface implementation
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

Implementation of: AMI_iTemplate::parse().

AMI_iTemplate interface implementation
// 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
    Locale path
  • string $locale
    Locale for data in locale file, use 'auto' for current locale
  • bool $override
    Flag specifying to override existing loaded locale

Implementation of: AMI_iTemplate::parseLocale().

AMI_iTemplate interface implementation
// Parses string.
public parseString ( string $string, [ $aScope = array() ] ) returns string;
  • string $string
    String to parse
  • array $aScope
    Scope

Implementation of: AMI_iTemplate::parseString().

AMI_iTemplate interface implementation
// 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

Implementation of: AMI_iTemplate::setBlockLocale().

AMI_iTemplate interface implementation
// Sets current template locale.
public setLocale ( string $locale ) returns void;
  • string $locale
    New locale name

Implementation of: AMI_iTemplate::setLocale().

AMI_iTemplate interface implementation