Laravel制作标题

时间:2017-05-05 11:09:48

标签: php laravel rss

如何在Laravel的响应视图中添加标题?

我试过了:

WP_Admin_Bar is located in wp-includes/class-wp-admin-bar.php.


i) admin_bar_init - This action hook is called at the very end of initialization.

ii) add_admin_bar_menus - This action hook is called at the end of the public add_menus() method.

但是收到错误。

我添加了这部分return View::make('rss', $data)->header('Content-Type', "application/rss+xml");

原文是:->header('Content-Type', "application/rss+xml")

1 个答案:

答案 0 :(得分:2)

试试这个:

return Response::view('hello')->header('Content-Type', $type);

或试试这个:

$contents = View::make('embedded')->with('foo', $foo);
$response = Response::make($contents, $statusCode);
$response->header('Content-Type', 'application/javascript');
return $response;