我刚刚开始学习 Laravel,可以做一个控制器和路由的基本知识。
我的操作系统是 Mac OS X Lion,它在 MAMP 服务器上。
返回文章页面我的代码译者:
Route::get('/', function() {
return View::make('home.index');
});
Route::get('businesses', function() {
return View::make('businesses.index');
});
Route::get('testing', function() {
return View::make('testing.index');
});
Route::get('hello', function() {
return "<h3>Hello world!</H3>";
});
That works, the views display perfectly, ''however'' what I want to try and do is include CSS within the views, I tried adding in a link to a stylesheet within the directory but the page displayed it as the default browser font even though the css was in the HTML!
这是来自 views 文件夹中的企业的 index.php:
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
<p>Business is a varied term. My content here.
我尝试使用刀片模板引擎在我的其他视图文件夹(测试)显示 CSS,但再次 CSS 没有显示,尽管它是在测试文件夹!
我如何才能克服这个问题,并变得更好-因为我正在慢慢学习这个框架。