class
KalimahApps
/
Daleel
/
ViewBuilder
ViewBuilder
Builder for blade views.
Properties
private
$blade_one eftec\...\BladeOne
BladeOne instance
Default: null
private
$output_path string
Path of the folder where views will be compiled to
Default: null
private
$build_path
Default: null
private
$shared_data
Default: []
private
$config
Default: null
public
$build_folder
Default: ''
private
static
$instance self
Singleton instance
Default: null
Methods
public
__construct ( ) : void
Initiate directory traversal and process elements.
public
setBuildFolder ( $build_folder ) : void
Set the build folder where views will be compiled to.
Parameters
-
$build_folder
string
Build folder name
public
static
getInstance ( $build_type ) : void
Get singleton instance.
Parameters
-
$build_type
string
Set the build type
public
share ( string $key , $value , $override ) : void
Share data with all views.
Parameters
-
$key
string
Key to share
-
$value
mixed
Value to share
-
$override
bool
Override existing value (for arrays)
public
shareMultiple ( array $data ) : void
Share multiple data with all views.
Parameters
-
$data
array
Data to share
public
buildView ( string $path , string $file_name , string $template , array $data ) : void
Build view using blade template engine.
Parameters
-
$path
string
Path to save file
-
$file_name
string
File name
-
$template
string
Template name
-
$data
array
Extra data to pass to template
public
buildIndexView ( array $data ) : void
Build index view at the root of the build folder.
Parameters
-
$data
array
Extra data to pass to template
public
getView ( string $template , array $data ) : void
Return view using blade template engine.
Parameters
-
$template
string
Template name
-
$data
array
Extra data to pass to template
public
copyAssets ( ) : void
Copy assest (css, js, images .. etc) to output folder.
public
copyVersionAssets ( ) : void
Copy version assets (css, js, images .. etc) to output folder.
public
getSharedData ( string $key ) : mixed
Get value from the shared data.
Parameters
-
$key
string
Key to get
public
getBladeOne ( ) : void
Get BladeOne instance.