PHP Class Devise\Pages\Interpreter\ViewOpener

"@include('some.path.here", ...) We will use Laravel's view path finder in order to transform the 'some.path.here' into a real file that we can open and inspect the html and thus fetch all devise tags from it.
Afficher le fichier Open project: devisephp/cms Class Usage Examples

Protected Properties

Свойство Type Description
$finder Illuminate\View\FileViewFinder Search for view paths

Méthodes publiques

Méthode Description
__construct ( Illuminate\View\FileViewFinder $finder = null, $file = null ) Construct a new view opener
findAllIncludedViews ( $viewPath, $ignore = [] ) : [type] Recursively finds every view that is included inside this view
open ( $includeStatement, &$includedViews ) : string Attempt to open the view path if something fails then we silently fail and return an empty string.
openViewPath ( [type] $path ) : [type] Find the real path

Méthodes protégées

Méthode Description
includeStatements ( string $content ) : array Gets the included views from all these matches
pathFromIncludeStatement ( $statement ) : null Finds the path from a $statement string. The pattern below searches for "@include('this.is.what.we.want', .

Method Details

__construct() public méthode

Construct a new view opener
public __construct ( Illuminate\View\FileViewFinder $finder = null, $file = null )
$finder Illuminate\View\FileViewFinder

findAllIncludedViews() public méthode

Recursively finds every view that is included inside this view
public findAllIncludedViews ( $viewPath, $ignore = [] ) : [type]
Résultat [type]

includeStatements() protected méthode

Gets the included views from all these matches
protected includeStatements ( string $content ) : array
$content string
Résultat array

open() public méthode

.. We have added the includedViews array so we do not attempt to open up those views (we don't need to because we've already found all the devise tags inside of those files since they've already been opened). If view#1 includes view#2 which includes view#1, this would have cause an infinite loop but b/c we keep up with which views have been included we know when to stop).
public open ( $includeStatement, &$includedViews ) : string
$includeStatement
$includedViews
Résultat string

openViewPath() public méthode

Find the real path
public openViewPath ( [type] $path ) : [type]
$path [type]
Résultat [type]

pathFromIncludeStatement() protected méthode

..)"
protected pathFromIncludeStatement ( $statement ) : null
$statement
Résultat null

Property Details

$finder protected_oe property

Search for view paths
protected Illuminate\View\FileViewFinder $finder
Résultat Illuminate\View\FileViewFinder