本文整理汇总了PHP中Picture::getByRefId方法的典型用法代码示例。如果您正苦于以下问题:PHP Picture::getByRefId方法的具体用法?PHP Picture::getByRefId怎么用?PHP Picture::getByRefId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Picture
的用法示例。
在下文中一共展示了Picture::getByRefId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
/**
* Show the form for editing the specified outlet.
*
* @param int $id
* @return Response
*/
public function edit($outlet)
{
$countries = Country::lists('country', 'id');
$cities = City::where('country_id', Country::DEFAULT_COUNTRY)->lists('city', 'id');
$retailers = Retailer::owner()->lists('name', 'id');
$addresses = Address::select(array('addresses.id', 'addresses.address'))->lists('address', 'id');
$images = Picture::getByRefId($outlet->id, 'outlet');
if ($outlet->status == 'active') {
$title = Lang::get('site/outlets/title.outlet_update');
} else {
$title = Lang::get('site/outlets/title.create_a_new_outlet');
}
return View::make('site.outlets.edit', compact('countries', 'cities', 'outlet', 'title', 'retailers', 'addresses'))->nest('imageForm', 'site.partials.image.create', ['refId' => $outlet->id, 'type' => 'outlet', 'images' => $images]);
}
示例2: editService
/**
* Show the form for editing the specified service.
*
* @param int $id
* @return Response
*/
public function editService($service)
{
if ($service->status == 'active') {
$title = Lang::get('site/services/title.service_update');
} else {
$title = Lang::get('site/services/title.create_a_new_service');
}
$outlets = Outlet::active()->owner()->lists('name', 'id');
$images = Picture::getByRefId($service->id, 'service');
return View::make('site.services.edit', compact('service', 'outlets', 'title'))->nest('imageForm', 'site.partials.image.create', ['refId' => $service->id, 'type' => 'service', 'images' => $images]);
}
示例3: editService
/**
* Show the form for editing the specified outlet.
*
* @param int $id
* @return Response
*/
public function editService($service)
{
$title = 'Edit Service';
$outlets = Outlet::lists('name', 'id');
$images = Picture::getByRefId($service->id, 'service');
return View::make('admin.services.edit', compact('service', 'outlets', 'title'))->nest('imageForm', 'site.partials.image.create', ['refId' => $service->id, 'type' => 'service', 'images' => $images]);
// return View::make('admin.services.edit', compact('service', 'title', 'outlets' ));
}
示例4: getEdit
/**
* Get edit user's profile
* @param $username
* @return mixed
*/
public function getEdit($username)
{
$userModel = new User();
$user = $userModel->getUserByUsername($username);
$countries = Country::lists('country', 'id');
$cities = City::where('country_id', Country::DEFAULT_COUNTRY)->lists('city', 'id');
// Check if the user exists
if (is_null($user)) {
return App::abort(404);
}
$images = Picture::getByRefId($user->id, 'user');
return View::make('site/user/edit', compact('user', 'countries', 'cities'))->nest('imageForm', 'site.partials.image.create', ['refId' => $user->id, 'type' => 'user', 'images' => $images]);
}