Documentation

Resource
in package

This class is using to load and save resources of application. All resources have to be in "resources" directory of application source files.

Table of Contents

GetExternalPathToResource()  : string
Returns an external path of resource
GetResource()  : string
Returns content of resource
SaveResource()  : void
Saves resource to target directory
SaveResourcesDirectory()  : void
Saves whole directory to target external directory

Methods

GetExternalPathToResource()

Returns an external path of resource

public static GetExternalPathToResource(string $pathToResource) : string
Parameters
$pathToResource : string
Tags
throws
ResourceException
Return values
string

GetResource()

Returns content of resource

public static GetResource(string $pathToResource) : string
Parameters
$pathToResource : string

Path to your resource from "resources" directory

Tags
throws
ResourceException

The resource does not exist or it is a directory

Return values
string

Content of resource

SaveResource()

Saves resource to target directory

public static SaveResource(string $pathToResource[, string|null $savePath = null ][, string|null $newFilename = null ]) : void
Parameters
$pathToResource : string
$savePath : string|null = null
$newFilename : string|null = null
Tags
throws
ResourceException
Return values
void

SaveResourcesDirectory()

Saves whole directory to target external directory

public static SaveResourcesDirectory(string $pathToResourcesDirectory[, string|null $savePath = null ]) : void
Parameters
$pathToResourcesDirectory : string
$savePath : string|null = null
Tags
throws
ResourceException
Return values
void

Search results