本文整理汇总了PHP中FilesModel::findMultipleByUuidsAndExtensions方法的典型用法代码示例。如果您正苦于以下问题:PHP FilesModel::findMultipleByUuidsAndExtensions方法的具体用法?PHP FilesModel::findMultipleByUuidsAndExtensions怎么用?PHP FilesModel::findMultipleByUuidsAndExtensions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FilesModel
的用法示例。
在下文中一共展示了FilesModel::findMultipleByUuidsAndExtensions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generate
/**
* Return if there are no files
*
* @return string
*/
public function generate()
{
if ($this->playerSRC == '') {
return '';
}
$source = deserialize($this->playerSRC);
if (!is_array($source) || empty($source)) {
return '';
}
$objFiles = \FilesModel::findMultipleByUuidsAndExtensions($source, array('mp4', 'm4v', 'mov', 'wmv', 'webm', 'ogv', 'm4a', 'mp3', 'wma', 'mpeg', 'wav', 'ogg'));
if ($objFiles === null) {
return '';
}
// Display a list of files in the back end
if (TL_MODE == 'BE') {
$return = '<ul>';
while ($objFiles->next()) {
$objFile = new \File($objFiles->path);
$return .= '<li><img src="' . TL_ASSETS_URL . 'assets/contao/images/' . $objFile->icon . '" width="18" height="18" alt="" class="mime_icon"> <span>' . $objFile->name . '</span> <span class="size">(' . $this->getReadableSize($objFile->size) . ')</span></li>';
}
return $return . '</ul>';
}
$this->objFiles = $objFiles;
return parent::generate();
}
示例2: generate
/**
* Return if there are no files
*
* @return string
*/
public function generate()
{
if ($this->playerSRC == '') {
return '';
}
$source = \StringUtil::deserialize($this->playerSRC);
if (!is_array($source) || empty($source)) {
return '';
}
$objFiles = \FilesModel::findMultipleByUuidsAndExtensions($source, array('mp4', 'm4v', 'mov', 'wmv', 'webm', 'ogv', 'm4a', 'mp3', 'wma', 'mpeg', 'wav', 'ogg'));
if ($objFiles === null) {
return '';
}
// Display a list of files in the back end
if (TL_MODE == 'BE') {
$return = '<ul>';
while ($objFiles->next()) {
$objFile = new \File($objFiles->path);
$return .= '<li>' . \Image::getHtml($objFile->icon, '', 'class="mime_icon"') . ' <span>' . $objFile->name . '</span> <span class="size">(' . $this->getReadableSize($objFile->size) . ')</span></li>';
}
return $return . '</ul>';
}
$this->objFiles = $objFiles;
return parent::generate();
}