本文整理匯總了PHP中Robots::generate方法的典型用法代碼示例。如果您正苦於以下問題:PHP Robots::generate方法的具體用法?PHP Robots::generate怎麽用?PHP Robots::generate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Robots
的用法示例。
在下文中一共展示了Robots::generate方法的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']);
});