PHP Class Todaymade\Daux\DauxHelper

Datei anzeigen Open project: justinwalsh/daux.io Class Usage Examples

Public Methods

Method Description
charsArray ( ) : array Returns the replacements for the slug() method.
getCleanPath ( string $path ) : string Remove all '/./' and '/.
getFile ( Directory $tree, string $request ) : Todaymade\Daux\Tree\Content | Tree\Raw | false Locate a file in the tree. Returns the file if found or false
getFilenames ( Config $config, string $part ) : string[] Get the possible output file names for a source file.
getRelativePath ( string $from, string $to ) : string
isAbsolutePath ( $path )
rebaseConfiguration ( Config $config, string $base_url ) Set a new base_url for the configuration
slug ( string $title ) : string Generate a URL friendly "slug" from a given string.

Protected Methods

Method Description
getTheme ( Config $params, string $current_url ) : array
resolveVariant ( Config $params )

Method Details

charsArray() public static method

Taken from Stringy
public static charsArray ( ) : array
return array An array of replacements.

getCleanPath() public static method

./' in a path, without actually checking the path
public static getCleanPath ( string $path ) : string
$path string
return string

getFile() public static method

Locate a file in the tree. Returns the file if found or false
public static getFile ( Directory $tree, string $request ) : Todaymade\Daux\Tree\Content | Tree\Raw | false
$tree Todaymade\Daux\Tree\Directory
$request string
return Todaymade\Daux\Tree\Content | Tree\Raw | false

getFilenames() public static method

Get the possible output file names for a source file.
public static getFilenames ( Config $config, string $part ) : string[]
$config Config
$part string
return string[]

getRelativePath() public static method

public static getRelativePath ( string $from, string $to ) : string
$from string
$to string
return string

getTheme() protected static method

protected static getTheme ( Config $params, string $current_url ) : array
$params Config
$current_url string
return array

isAbsolutePath() public static method

public static isAbsolutePath ( $path )

rebaseConfiguration() public static method

Set a new base_url for the configuration
public static rebaseConfiguration ( Config $config, string $base_url )
$config Config
$base_url string

resolveVariant() protected static method

protected static resolveVariant ( Config $params )
$params Config

slug() public static method

Taken from Stringy
public static slug ( string $title ) : string
$title string
return string