本文整理汇总了PHP中RevSlide::createSlide方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSlide::createSlide方法的具体用法?PHP RevSlide::createSlide怎么用?PHP RevSlide::createSlide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevSlide
的用法示例。
在下文中一共展示了RevSlide::createSlide方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createSlideFromData
/**
*
* create a slide from input data
*/
public function createSlideFromData($data, $returnSlideID = false)
{
$sliderID = UniteFunctionsRev::getVal($data, "sliderid");
$obj = UniteFunctionsRev::getVal($data, "obj");
UniteFunctionsRev::validateNotEmpty($sliderID, "Slider ID");
$this->initByID($sliderID);
if (is_array($obj)) {
//multiple
foreach ($obj as $item) {
$slide = new RevSlide();
$slideID = $slide->createSlide($sliderID, $item);
}
return count($obj);
} else {
//signle
$urlImage = $obj;
$slide = new RevSlide();
$slideID = $slide->createSlide($sliderID, $urlImage);
if ($returnSlideID == true) {
return $slideID;
} else {
return 1;
}
//num slides -1 slide created
}
}
示例2: createSlideFromData
/**
*
* create a slide from input data
*/
public function createSlideFromData($data)
{
$sliderID = UniteFunctionsRev::getVal($data, "sliderid");
$urlImage = UniteFunctionsRev::getVal($data, "url_image");
UniteFunctionsRev::validateNotEmpty($sliderID, "Slider ID");
UniteFunctionsRev::validateNotEmpty($urlImage, "image url");
$this->initByID($sliderID);
$slide = new RevSlide();
$slideID = $slide->createSlide($sliderID, $urlImage);
return $slideID;
}