本文整理匯總了PHP中UniteFunctionsRev::trimArrayItems方法的典型用法代碼示例。如果您正苦於以下問題:PHP UniteFunctionsRev::trimArrayItems方法的具體用法?PHP UniteFunctionsRev::trimArrayItems怎麽用?PHP UniteFunctionsRev::trimArrayItems使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UniteFunctionsRev
的用法示例。
在下文中一共展示了UniteFunctionsRev::trimArrayItems方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: createUpdateSliderFromOptions
/**
*
* create / update slider from options
*/
private function createUpdateSliderFromOptions($options, $sliderID = null, $settingsMain, $settingsParams)
{
$arrMain = UniteFunctionsRev::getVal($options, "main");
$params = UniteFunctionsRev::getVal($options, "params");
$isTemplate = UniteFunctionsRev::getVal($options, "template");
if ($isTemplate == "true") {
$params['template'] = "true";
} else {
$params['template'] = "false";
}
//trim all input data
$arrMain = UniteFunctionsRev::trimArrayItems($arrMain);
//modify the data
$arrMain = $settingsMain->setStoredValues($arrMain);
$params = UniteFunctionsRev::trimArrayItems($params);
$params = $settingsParams->setStoredValues($params);
$params = array_merge($arrMain, $params);
$title = UniteFunctionsRev::getVal($arrMain, "title");
$alias = UniteFunctionsRev::getVal($arrMain, "alias");
if (!empty($sliderID)) {
$this->initByID($sliderID);
}
$this->validateInputSettings($title, $alias, $params);
$jsonParams = json_encode($params);
//insert slider to database
$arrData = array();
$arrData["title"] = $title;
$arrData["alias"] = $alias;
$arrData["params"] = $jsonParams;
if (empty($sliderID)) {
//create slider
$sliderID = $this->db->insert(GlobalsRevSlider::$table_sliders, $arrData);
return $sliderID;
} else {
//update slider
$this->initByID($sliderID);
$sliderID = $this->db->update(GlobalsRevSlider::$table_sliders, $arrData, array("id" => $sliderID));
}
}