本文整理匯總了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();
}