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

The AMI_Storage_Template class

• Introduction

Template storage storage.

• Class synopsis

AMI_Storage_Template implements AMI_iStorage {
/* Properties */
// Mode
protected int $mode;
// DB object
protected DB_si $oDB;
// System teplate object
protected gui $oTpl;
/* Methods */
// Constructor.
public __construct ( ) returns AMI_Storage_Template;
// Copies file.
public copy ( string $from, string $to ) returns bool;
// Deletes a file.
public delete ( string $file ) returns bool;
// Checks whether a file or directory exists.
public exists ( string $file ) returns int;
// Reads entire file into a string.
public load ( string $file, [ bool $warn = TRUE ] ) returns mixed;
// Makes directory.
public mkdir ( string $path ) returns bool;
// Renames a file.
public rename ( string $from, string $to ) returns bool;
// Removes directory.
public rmdir ( string $path, [ bool $silent = FALSE ] ) returns bool;
// Write a string to a file.
public save ( string $file, string $content, [ bool $asDefault = FALSE ] ) returns bool;
// Set mode.
public setMode ( int $mode ) returns void;
// Divedes file for path and name.
protected divideFile ( string $file ) returns array;
// Returns table name by file extension.
protected getTable ( string $file ) returns string;
// Switches template engine to front/admin mode.
protected switchTplMode ( ) returns void;
}
Tags:
resource storage/tpl AMI::getResource('storage/tpl')
since 6.0.2

• Class Properies

protected int $mode

Mode

protected DB_si $oDB

DB object

protected gui $oTpl

System teplate object

• Class Methods

// Constructor.
public __construct ( ) returns AMI_Storage_Template;
// Copies file.
public copy ( string $from, string $to ) returns bool;
  • string $from
    Path to the source file
  • string $to
    The destination path

Implementation of: AMI_iStorage::copy().

// Deletes a file.
public delete ( string $file ) returns bool;
  • string $file
    Path to the file

Implementation of: AMI_iStorage::delete().

// Checks whether a file or directory exists.
public exists ( string $file ) returns int;
  • string $file
    Path to the file

Implementation of: AMI_iStorage::exists().

// Reads entire file into a string.
public load ( string $file, [ bool $warn = TRUE ] ) returns mixed;
  • string $file
    Name of the file to read
  • bool $warn
    Flag specifying to warn if cannot load

Implementation of: AMI_iStorage::load().

// Makes directory.
public mkdir ( string $path ) returns bool;
  • string $path
    The directory path

Implementation of: AMI_iStorage::mkdir().

// Renames a file.
public rename ( string $from, string $to ) returns bool;
  • string $from
    The old name
  • string $to
    The new name

Implementation of: AMI_iStorage::rename().

// Removes directory.
public rmdir ( string $path, [ bool $silent = FALSE ] ) returns bool;
  • string $path
    The directory path
  • bool $silent
    Skip warning if failed

Implementation of: AMI_iStorage::rmdir().

// Write a string to a file.
public save ( string $file, string $content, [ bool $asDefault = FALSE ] ) returns bool;
  • string $file
    Path to the file where to write the data
  • string $content
    The data to write
  • bool $asDefault
    Save as default content

Implementation of: AMI_iStorage::save().

// Set mode.
public setMode ( int $mode ) returns void;
  • int $mode
    Mode

Implementation of: AMI_iStorage::setMode().

// Divedes file for path and name.
protected divideFile ( string $file ) returns array;
  • string $file
    File name
// Returns table name by file extension.
protected getTable ( string $file ) returns string;
  • string $file
    File name
// Switches template engine to front/admin mode.
protected switchTplMode ( ) returns void;