YeeBase Functions
isUnixTimeStamp
Return true if string is a valid unix timestamp, false if not.
createProxyUrl
YeeBase::createProxyUrl($controller, $urlPart, $urlParams)
Create a 'Proxy URL' that can bypass cloudflare. This is a workaround to some of the cloudflare limitation such as timeout and max POST limit. It uses config Yii::app()->params['noProxyUrl']
to build the URL string.
clearCache
YeeBase::clearCache($cacheId = '')
Clear cache either by specific cache ID or flush the entire cache
modelErrors2String
YeeBase::modelErrors2String($model->getErrors())
Return form model errors in a string representation (which originally an array). This is handy like in situation you need to throw exception message.
configVar2value
YeeBase::configVar2value($var, $yamlItem)
parseStrSelect
YeeBase::parseStrSelect($string, $selector)
runPOpen
YeeBase::runPOpen($command, $pathOutput, $forceRewrite = true, $echo = false)
getVersion
YeeBase::getVersion()
Return the application version with value like '1.1.2.4614'. It's a combination of .version
and .build
file in /public_html/
getVersionWithoutBuild()
YeeBase::getVersionWithoutBuild()
Return the application version without the build version, value like '1.1.2'. It takes value from.version
file in /public_html/.
getControllersInPath
YeeBase::getControllersInPath($path, $withPostfixController = true)
To get the list of controllers by specific file path. $path
is the full path to the directory. e.g.: /var/www/open_hub/protected/controllers
getControllersInPath('/var/www/open_hub/protected/controllers')
getControllersInPath('/var/www/open_hub/protected/controllers', false)
getActionsInController
YeeBase::getActionsInController($controllerName, $moduleKey = '', $withPrefixAction = true)
This will return a list of actions name inside a controller which belongs to base or module.
YeeBase::getActionsInController('TestController', 'boilerplateStart')
YeeBase::getActionsInController('TestController', 'boilerplateStart', false)
YeeBase::getActionsInController('SiteController')
getActionsInControllerPath
YeeBase::getActionsInControllerPath($controllerFilePath, $withPrefixAction = true)
Use this to get the list of actions name (without prefix action
) by specific controller file path. $controllerFilePath
is the full path to the controller. e.g.: /var/www/open_hub/protected/controllers/SiteController.php
roleCheckerAction
YeeBase::roleCheckerAction($role, $controller, $action = '')
To check whether role is allowed to access the route / action
beginProfile
YeeBase::beginProfile($code)
Auto check with configYii::app()->params['enableProfileLog']
internally.
endProfile
YeeBase::endProfile($code)
Auto check with configYii::app()->params['enableProfileLog']
internally.
jsonEncode
YeeBase::jsonEncode($array, $flags = 0, $depth = 512)
Use this function to encode array to json will make sure any charset entry will be converted to utf-8 first, hence prevent return null issue if other charset passed it. it required the none default mbstring module to be enabled.
jsonDecode
YeeBase::jsonDecode($array, $associative = null, $depth = 512, $flags = 0)
Last updated
Was this helpful?