我无法连接到资产&链接路径

时间:2015-02-22 10:39:31

标签: laravel laravel-4 laravel-routing laravel-5

我想链接路径资源和其他页面。请帮助我,我应该怎么做???

问题!

现在,我可以连接到http://yoseigi.com/night/,但我无法连接内部的资产。

[骨架] /laravelfiles/app/view/index.blade.php

@extends('layouts.ace.login')

@section('pagecontent')
    @{{ app_path() = }} <?php echo $path = app_path(); ?>
@stop 

[skeleton] /lavelveliles/app/view/layouts/ace/login.blade.php(代码资产路径)

{{-- Bootstrap --}}
{{ HTML::style('assets/bootstrap/css/bootstrap.min.css') }}
{{ HTML::style('assets/bootstrap/css/bootstrap-theme.min.css') }}

样式表 - &gt; “Index.php”?????

"NetworkError: 404 Not Found - http://yoseigi.com/night/Index.php/assets/bootstrap/css/bootstrap.min.css"
"NetworkError: 404 Not Found - http://yoseigi.com/night/Index.php/assets/bootstrap/css/bootstrap-theme.min.css"

yoseigi.com/dashboard

"NetworkError: 404 Not Found - http://yoseigi.com/night/dashboard"

路线

[骨架] /laravelfiles/app/routes.php

Route::get('/', function() {
    return View::make('index');
});
Route::get('dashboard', function() {
    return View::make('dashboard');
});

目录

yoseigi.com
|--httpdocs
    |--night
        |--assets
            |--ace
               |--css
               |--js
            |--bootstrap
               |--css
               |--js
        |--laravelfiles
            |--app
               |--config
                    |--app.php
                    |--view.php
               |--views
                    |--layouts
                        |--login.blade.php
                    |--dashboard.blade.php
                    |--index.blade.php
               |--routes.php
            |--bootstrap
               |--autoload.php
               |--paths.php
               |--start.php
        |--packages
        |--.htaccess
        |--index.php

htaccess的

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
    #RewriteRule ^(.+)$ /index.php [L]
</IfModule>

配置

[骨架]的index.php

require __DIR__.'/laravelfiles/bootstrap/autoload.php';
$app = require_once __DIR__.'/laravelfiles/bootstrap/start.php';

[骨架] /laravelfiles/bootstrap/paths.php

'app' => __DIR__.'/../app',
'public' => __DIR__.'/../..',
'base' => __DIR__.'/..',
'storage' => __DIR__.'/../app/storage',

[骨架] /laravelfiles/app/config/view.php

'paths' => array(__DIR__.'/../views'),
'pagination' => 'pagination::slider-3',

1 个答案:

答案 0 :(得分:0)

不要使用HTML外观,请尝试使用asset()帮助程序。

<link rel="stylesheet" href="{{ asset('assets/bootstrap/css/bootstrap.min.css') }}">