PHP Class CMS\Page

Inheritance: extends Model
Afficher le fichier Open project: sphido/cms Class Usage Examples

Méthodes publiques

Свойство Type Description
$children array

Protected Properties

Свойство Type Description
$content string | null
$meta array

Méthodes publiques

Méthode Description
__construct ( $file = null, array $meta = [], $content = null )
__get ( string $name ) : null Return file metadata value
__isset ( string $name ) : boolean
__set ( string $name, mixed $value ) Set meta value
fromPath ( string $path, array $meta = [] ) : static Create new File instance from path
getContent ( ) : string Return file content
getDescription ( ) : mixed Return automatic description Notice: getDescription use slow function shorten() in some cases
getDir ( ) : string Return current directory
getMeta ( array $meta = [] ) : array Return current file metadata
getName ( ) : string Return name of file without extension
getSlug ( string | null $src = null ) : string Return link to file
getUrl ( null | string $src = null ) : string
is ( string $ext ) : boolean Check extension.
isValid ( array $skip = [] ) : boolean
setContent ( string $content ) Set file content

Method Details

__construct() public méthode

public __construct ( $file = null, array $meta = [], $content = null )
$meta array

__get() public méthode

Return file metadata value
public __get ( string $name ) : null
$name string
Résultat null

__isset() public méthode

public __isset ( string $name ) : boolean
$name string
Résultat boolean

__set() public méthode

Set meta value
public __set ( string $name, mixed $value )
$name string
$value mixed

fromPath() public static méthode

Create new File instance from path
public static fromPath ( string $path, array $meta = [] ) : static
$path string
$meta array
Résultat static

getContent() public méthode

Return file content
public getContent ( ) : string
Résultat string

getDescription() public méthode

Return automatic description Notice: getDescription use slow function shorten() in some cases
public getDescription ( ) : mixed
Résultat mixed

getDir() public méthode

Return current directory
public getDir ( ) : string
Résultat string

getMeta() public méthode

Return current file metadata
public getMeta ( array $meta = [] ) : array
$meta array
Résultat array

getName() public méthode

Return name of file without extension
public getName ( ) : string
Résultat string

getSlug() public méthode

Return link to file
public getSlug ( string | null $src = null ) : string
$src string | null
Résultat string

getUrl() public méthode

public getUrl ( null | string $src = null ) : string
$src null | string
Résultat string

is() public méthode

Check extension.
public is ( string $ext ) : boolean
$ext string
Résultat boolean

isValid() public méthode

public isValid ( array $skip = [] ) : boolean
$skip array
Résultat boolean

setContent() public méthode

Set file content
public setContent ( string $content )
$content string

Property Details

$children public_oe property

public array $children
Résultat array

$content protected_oe property

protected string|null $content
Résultat string | null

$meta protected_oe property

protected array $meta
Résultat array