本文整理汇总了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"]);
}