本文整理汇总了PHP中Robots::addUserAgent方法的典型用法代码示例。如果您正苦于以下问题:PHP Robots::addUserAgent方法的具体用法?PHP Robots::addUserAgent怎么用?PHP Robots::addUserAgent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Robots
的用法示例。
在下文中一共展示了Robots::addUserAgent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateRobots
public function generateRobots()
{
if (App::environment() == 'production') {
Robots::addUserAgent('*');
Robots::addDisallow('/konto');
Robots::addDisallow('/*/szukaj');
Robots::addSitemap('/sitemap.xml');
} else {
Robots::addUserAgent('*');
Robots::addDisallow('*');
}
return Response::make(Robots::generate(), 200, array('Content-Type' => 'text/plain'));
}
示例2: foreach
return Redirect::to('http://'.env('WEB'), 301);
});*/
Route::get('/', 'PagesController@index');
foreach (Lang::get('routes') as $k => $v) {
Route::pattern($k, $v);
}
Route::get('/{seo}/', 'PagesController@seo');
Route::get('/{programming}/', 'PagesController@programming');
Route::get('/{design}/', 'PagesController@design');
Route::get('/{services}/', 'PagesController@services');
Route::get('/{contacts}/', 'PagesController@contacts');
Route::post('send-mail', 'PagesController@sendMail');
Route::get('sitemap', 'SitemapsController@index');
Route::get('sitemap.xml', 'SitemapsController@index');
} elseif ($routing_schema == 'homepage') {
Route::get('/', 'PagesController@home');
Route::post('send-mail', 'PagesController@sendMail');
Route::get('sitemap', 'SitemapsController@indexSingle');
Route::get('sitemap.xml', 'SitemapsController@indexSingle');
}
Route::get('robots.txt', function () {
if (App::environment() == 'production') {
// If on the live server, serve a nice, welcoming robots.txt.
Robots::addUserAgent('*');
Robots::addSitemap('sitemap');
} else {
// If you're on any other server, tell everyone to go away.
Robots::addDisallow('*');
}
return Response::make(Robots::generate(), 200, ['Content-Type' => 'text/plain']);
});