本文整理汇总了PHP中Domain::seoURL方法的典型用法代码示例。如果您正苦于以下问题:PHP Domain::seoURL方法的具体用法?PHP Domain::seoURL怎么用?PHP Domain::seoURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Domain
的用法示例。
在下文中一共展示了Domain::seoURL方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: searchAjax
public function searchAjax()
{
$response = '';
$search_term = trim(e(Input::get('search_term')));
$domains = Domain::where('status', 1)->where('name', 'LIKE', '%' . $search_term . '%')->orWhere('url', 'LIKE', '%' . $search_term . '%')->orWhere('description', 'LIKE', '%' . $search_term . '%')->take(5)->get(['id', 'name', 'thumb']);
if (count($domains)) {
foreach ($domains as $domain) {
$domain_name = strlen($domain->name) > 30 ? substr($domain->name, 0, 30) . '...' : $domain->name;
$response .= '<div class="search-box">
<a class="search-result-row" href="' . Domain::seoURL($domain->id) . '">
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-5">
<img class="img img-responsive thumbnail"
src="' . URL::asset('assets/thumbs/' . $domain->thumb) . '" alt="site preview" />
</div>
<div class="col-lg-7 col-md-7 col-sm-7 col-xs-7">
' . $domain_name . '
</div>
<div class="clearfix"></div>
</a>
</div>';
}
} else {
$response .= '<p>' . Lang::get('general.no_results', ['serch_term' => $search_term]) . '</p>';
}
print $response;
}
示例2: editComment
public function editComment()
{
if (!Acl::isSuperAdmin()) {
return Redirect::route('home');
}
$id = e(Input::get('id'));
$comment = Comment::find($id);
$comment->comment = e(Input::get('comment'));
$comment->save();
return Redirect::to(Domain::seoURL($comment->domain->id))->with('success', trans('directory.comment_updated'));
}
示例3: approveHandle
public function approveHandle($id)
{
$domain = Domain::find($id);
$domain->status = 1;
$domain->save();
$next_domain = Domain::where('status', 0)->first();
if ($next_domain) {
$name = Domain::seoURL($next_domain->id);
return $this->details($name, $next_domain->id);
}
return Redirect::route('home')->with('success', 'Yoohoo you\'re done!');
}
示例4: foreach
<?php
echo '<?xml version="1.0" encoding="UTF-8"?>';
?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<?php
$domains = Domain::where('status', 1)->orderBy('updated_at', 'DESC')->get(['id', 'updated_at']);
if ($domains) {
foreach ($domains as $domain) {
$ro_url = LaravelLocalization::getLocalizedURL('ro', Domain::seoURL($domain->id), 'ro');
$en_url = LaravelLocalization::getLocalizedURL('en', Domain::seoURL($domain->id), 'en');
?>
<url>
<loc><?php
echo $ro_url;
?>
</loc>
<xhtml:link rel="alternate" hreflang="ro" href="<?php
echo $ro_url;
?>
" />
<xhtml:link rel="alternate" hreflang="en" href="<?php
echo $en_url;
?>
" />
<priority>1</priority>
<lastmod><?php
echo date('c', strtotime($domain->updated_at));
?>
</lastmod>
示例5: function
}]);
Route::post('search', ['as' => 'search.post', 'uses' => 'HomeController@searchAjax']);
Route::get('generate-sitemap', function () {
ini_set('memory_limit', '2048M');
$domains = Domain::where('status', 1)->get(['id', 'updated_at']);
$categories = Category::where('status', 1)->get(['path', 'updated_at']);
$langs = LaravelLocalization::getSupportedLocales();
// create new sitemap object
$sitemap = App::make("sitemap");
// set cache (key (string), duration in minutes
// (Carbon|Datetime|int), turn on/off (boolean))
// by default cache is disabled
//$sitemap->setCache('laravel.sitemap', 3600);
$i = 0;
$ci = 0;
foreach ($domains as $domain) {
$translations = array(array('url' => LaravelLocalization::getLocalizedURL('ro', Domain::seoURL($domain->id), 'ro'), 'language' => 'ro'), array('url' => LaravelLocalization::getLocalizedURL('en', Domain::seoURL($domain->id), 'en'), 'language' => 'en'));
foreach ($langs as $lang_code => $lang_details) {
$sitemap->add(LaravelLocalization::getLocalizedURL($lang_code, Domain::seoURL($domain->id)), date('c', strtotime($domain->updated_at)), 1.0, 'daily', null, null, $translations);
}
$i++;
}
foreach ($categories as $category) {
$ctranslations = array(array('url' => LaravelLocalization::getLocalizedURL('ro', URL::route('category.details', [$category->path]), 'ro'), 'language' => 'ro'), array('url' => LaravelLocalization::getLocalizedURL('en', URL::route('category.details', [$category->path]), 'en'), 'language' => 'en'));
foreach ($langs as $lang_code => $lang_details) {
$sitemap->add(LaravelLocalization::getLocalizedURL($lang_code, URL::route('category.details', [$category->path])), date('c', strtotime($category->updated_at)), 1.0, 'daily', null, null, $ctranslations);
}
$ci++;
}
$r = $sitemap->store('xml');
});