Trait Assets
Trait for class MvcCore\Ext\Form
containing methods to complete
configured field's supporting js and css files to render them properly.
Methods summary
protected
array
|
#
completeSupportingFilesToRender( boolean $javascriptFiles = TRUE )
Complete JS/CSS supporting file(s) to add them after rendered <form> element
or to add them into response by external renderer. This function processes all
assets necessary to and filters them for asset files already added into response.
Complete JS/CSS supporting file(s) to add them after rendered <form> element
or to add them into response by external renderer. This function processes all
assets necessary to and filters them for asset files already added into response.
Parameters
- $javascriptFiles
TRUE to complete supporting files from $form->jsSupportFiles , FALSE to complete them from $form->cssSupportFiles .
Returns
array
|
protected static
string
|
#
absolutizeSupportingFilePath( string $supportingFileRelPath = '', string $javascriptFiles = TRUE )
Absolutize supporting JS/CSS relative file path. Every field has configured
it's supporting css or js file with absolute path replacement inside supporting
file path string by __MVCCORE_FORM_ASSETS_DIR__ substring.
Replace now the replacement substring by prepared properties values
\MvcCore\Ext\Form::$jsAssetsRootDir or \MvcCore\Ext\Form::$cssAssetsRootDir to set path into
library assets folder by default or to set path into any other customized defined directory.
Absolutize supporting JS/CSS relative file path. Every field has configured
it's supporting css or js file with absolute path replacement inside supporting
file path string by __MVCCORE_FORM_ASSETS_DIR__ substring.
Replace now the replacement substring by prepared properties values
\MvcCore\Ext\Form::$jsAssetsRootDir or \MvcCore\Ext\Form::$cssAssetsRootDir to set path into
library assets folder by default or to set path into any other customized defined directory.
Parameters
- $supportingFileRelPath
- Supporting file relative path with
__MVCCORE_FORM_ASSETS_DIR__ replacement substring.
- $javascriptFiles
TRUE to complete supporting files from $form->jsSupportFiles , FALSE to complete them from $form->cssSupportFiles .
Returns
string Return absolute path to supporting javascript.
|
protected
|
#
renderSupportingFile( string & $content, string & $absolutePath, boolean $useExternalRenderer = FALSE, callable & $rendererHandler = NULL )
Render supporting js/css file. Add it's content after given first
argument string $content or call external renderer handler.
Render supporting js/css file. Add it's content after given first
argument string $content or call external renderer handler.
Parameters
- $content
- HTML content code with rendered supporting JS/CSS files.
- $absolutePath
- Absolute path to supporting JS/CSS file.
- $useExternalRenderer
TRUE to use any external configured renderer callable , default FALSE .
- $rendererHandler
- External renderer
callable accepting first argument as \SplFileInfo about supporting JS/CSS file.
|