简体   繁体   English

Laravel 4:路线包

[英]Laravel 4: Route package

I am trying to put routes into a package and I am able to run the route in the package after reading this: http://laravel.com/docs/packages#package-routing 我试图将路由放入一个包中,我可以在阅读之后在包中运行该路由: http//laravel.com/docs/packages#package-routing

Example working route in package: 包中示例工作路线:

Route::get('pack', function()
{
    return 'It works!!!';
});

Now I am able to get the return from route properly and display 'It works!!!!' 现在我能够正确地从路线返回并显示“它工作!!!!” on the webpage. 在网页上。 However, how can I set the route to display a file from the package? 但是,如何设置路径以显示包中的文件? I was trying with return View::make('test'); 我试着return View::make('test'); but it didn't works. 但它不起作用。

Thank you. 谢谢。

将文件放在src/views文件夹中并加载它:

\View::make('packageName::test');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM