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

The AMI_View class

• Introduction

View abstraction.

• Class synopsis

AMI_View {
/* Properties */
// Locale
protected array $aLocale = array();
// Scope
protected array $aScope = array();
// Locale file name
protected string $localeFileName = '';
// Model
protected mixed $oModel = null;
// Template block name
protected string $tplBlockName = '';
// Template file name
protected string $tplFileName = '';
/* Methods */
// Constructor.
public __construct ( ) returns AMI_View;
// Adds locale.
public addLocale ( $aLocale, [ bool $doOverwrite = true ] ) returns AMI_View;
// Adds script code.
public addScriptCode ( string $code ) returns AMI_View;
// Adds script file.
public addScriptFile ( string $file ) returns AMI_View;
// Returns view data.
public get ( ) returns mixed;
// Initialize, processing after setting model.
public init ( ) returns AMI_View;
// Adds locale from resource.
public setModel ( mixed $oModel, [ $aLocale = array() ], string $path ) returns AMI_View;
// Set module id.
public setModId ( string $modId ) returns void;
// Sets view scope.
public setScope ( $aScope ) returns AMI_View;
protected addOpenGraphTags ( $header, $description, [ $image = '' ] ) returns void;
// Returns module id.
protected getModId ( ) returns string;
// Returns module specific locale path.
protected getModLocalePath ( ) returns string;
// Returns prepared view scope.
protected getScope ( string $type, [ $aScope = array() ] ) returns array;
// Returns template object.
protected getTemplate ( ) returns AMI_iTemplate;
// Parses block template and returns the result as a string.
protected parse ( string $setName, [ $aScope = array() ] ) returns string;
// Sets up model object.
protected _setModel ( mixed $oModel ) returns AMI_View;
}
Tags:
abstract

• Class Properies

protected array $aLocale

Locale

protected array $aScope

Scope

protected string $localeFileName

Locale file name

protected mixed $oModel

Model

protected string $tplBlockName

Template block name

protected string $tplFileName

Template file name

• Class Methods

// Adds locale.
public addLocale ( $aLocale, [ bool $doOverwrite = true ] ) returns AMI_View;
  • array $aLocale
    Locale array
  • bool $doOverwrite
    Overwrite existing keys (since 5.14.0)
// Adds script code.
public addScriptCode ( string $code ) returns AMI_View;
  • string $code
    JS code without html SCRIPT tags
  Example:
Tags:
since 6.0.6
// Adds script file.
public addScriptFile ( string $file ) returns AMI_View;
  • string $file
    Script file
  Example:
  •  // AmiSample_FormViewAdm::__construct()
  •  // ...
  •  // Add custom script to admin vorm view
  •  $this->addScriptFile('_local/plugins_distr/' $this->getModId(.  '/templates/form.adm.js');
Tags:
todo True implementation
// Adds locale from resource.
public setModel ( mixed $oModel, [ $aLocale = array() ], string $path ) returns AMI_View;
  • string $path
    Locales path
// Set module id.
public setModId ( string $modId ) returns void;
  • string $modId
    Module id

Overridden in child classes as: AMI_ModCommonViewFrn::setModId().

// Sets view scope.
public setScope ( $aScope ) returns AMI_View;
  • array $aScope
    Scope
protected addOpenGraphTags ( $header, $description, [ $image = '' ] ) returns void;
  • $header
  • $description
  • $image
// Returns module id.
protected getModId ( ) returns string;

Overridden in child classes as: AMI_ModCommonViewFrn::getModId().

// Returns module specific locale path.
protected getModLocalePath ( ) returns string;
// Returns prepared view scope.
protected getScope ( string $type, [ $aScope = array() ] ) returns array;
  • string $type
    View type
  • array $aScope
    Scope
// Returns template object.
protected getTemplate ( ) returns AMI_iTemplate;
// Parses block template and returns the result as a string.
protected parse ( string $setName, [ $aScope = array() ] ) returns string;
  • string $setName
    Set name
  • array $aScope
    Scope
Tags:
since 5.14.4
// Sets up model object.
protected _setModel ( mixed $oModel ) returns AMI_View;
  • mixed $oModel
    Model