本文整理匯總了PHP中app\Board::getBanners方法的典型用法代碼示例。如果您正苦於以下問題:PHP Board::getBanners方法的具體用法?PHP Board::getBanners怎麽用?PHP Board::getBanners使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\Board
的用法示例。
在下文中一共展示了Board::getBanners方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getAssets
/**
* Display existing assets.
*
* @return Response
*/
public function getAssets(Board $board)
{
if (!$board->canEditConfig($this->user)) {
return abort(403);
}
return $this->view(static::VIEW_CONFIG, ['board' => $board, 'banned' => $board->getBannedImages(), 'banners' => $board->getBanners(), 'tab' => "assets"]);
}
示例2: putAssets
/**
* Display existing assets.
*
* @return Response
*/
public function putAssets(Request $request, Board $board)
{
if (!$board->canEditConfig($this->user)) {
return abort(403);
}
$input = Input::all();
$validator = Validator::make($input, ['asset_type' => ["required", "in:board_banner,file_deleted,file_none,file_spoiler"], 'new_board_banner' => ["required_if:asset_type,board_banner", "image", "image_size:<=300,<=100"]]);
if (!$validator->passes()) {
return redirect()->back()->withErrors($validator->errors());
}
// Fetch the asset.
$upload = Input::file("new_{$input['asset_type']}");
if (file_exists($upload->getPathname())) {
$storage = FileStorage::storeUpload($upload);
$asset = new BoardAsset();
$asset->asset_type = "board_banner";
$asset->board_uri = $board->board_uri;
$asset->file_id = $storage->file_id;
$asset->save();
}
return $this->view(static::VIEW_CONFIG, ['board' => $board, 'banners' => $board->getBanners(), 'tab' => "assets"]);
}