本文整理匯總了PHP中Gallery::album方法的典型用法代碼示例。如果您正苦於以下問題:PHP Gallery::album方法的具體用法?PHP Gallery::album怎麽用?PHP Gallery::album使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Gallery
的用法示例。
在下文中一共展示了Gallery::album方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: destroy
/**
* Remove the specified album from the database.
*
* @param int $id Id of the album
* @return \Illuminate\View\View
*/
public function destroy($id)
{
$album = new Entity\Album();
$album->map(['id' => $id]);
\Gallery::album()->delete($album);
return \Redirect::route("gallery")->with('alertsuccess', \Lang::get('gallery::gallery.removal'));
}
示例2: edit
/**
* Show the form for editing the specified photo.
*
* @param int $albumId Id of the album
* @param int $photoId Id of the photo
* @return \Illuminate\View\View
*/
public function edit($albumId, $photoId)
{
$photo = \Gallery::photo()->find($photoId);
$albumArray = \Gallery::album()->all()->toArray();
foreach ($albumArray as $album) {
$dropdown[$album->getId()] = $album->getName();
}
$data = array('type' => 'photo', 'dropdown' => $dropdown, 'photo' => $photo);
return view('gallery::edit', $data)->with('form', 'gallery::partials.edit-photo');
}
示例3: index
/**
* Show a list of all the albums.
*
* @return \Illuminate\View\View
*/
public function index()
{
$allAlbums = \Gallery::album()->all();
return view('gallery::index', ['allAlbums' => $allAlbums]);
}