本文整理匯總了PHP中Tag::whereSlug方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tag::whereSlug方法的具體用法?PHP Tag::whereSlug怎麽用?PHP Tag::whereSlug使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Tag
的用法示例。
在下文中一共展示了Tag::whereSlug方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getAjaxTag
/**
* @return mixed
*/
public function getAjaxTag()
{
$value = Tag::whereSlug($_GET['tag_id'])->first()->toJson();
return $value;
}
示例2: getProduct
/**
* @param $slug
* @return mixed
*/
public static function getProduct($slug)
{
$value = Tag::whereSlug($slug)->first();
return Product::whereTag_id($value['id'])->get();
}
示例3: newProduct
/**
* [newProduct description]
* @param [type] $slug [description]
* @return [type] [description]
*/
public function newProduct($slug)
{
$data['tag_id'] = Tag::whereSlug($slug)->first();
$manufactures = Manufacture::all();
foreach ($manufactures as $manufacture) {
$mf[$manufacture->id] = $manufacture->name;
}
$data['content_header'] = "Add New " . ucfirst($slug) . " Product";
$data['url'] = URL::route('product.new.save', $slug);
$data['submit'] = "Add New Product";
$data['manufacture'] = $mf;
return View::make('admin.product.new', $data);
}
示例4: function
<?php
Route::bind('posts', function ($value, $route) {
return Post::whereSlug($value)->firstOrFail();
});
Route::bind('series', function ($value, $route) {
return Series::whereSlug($value)->firstOrFail();
});
Route::bind('tags', function ($value, $route) {
return Tag::whereSlug($value)->firstOrFail();
});
Route::bind('projects', function ($value, $route) {
return Project::whereSlug($value)->firstOrFail();
});
Route::model('users', 'User');
示例5: doEdit
public static function doEdit($array)
{
$update = Tag::whereSlug($array['tag_edit_slug'])->update(array('name' => $array['name'], 'template' => $array['template'], 'slug' => Str::slug($array['name'])));
return;
}