2016-02-23 82 views
0

我使用渲染將刀片轉換爲字符串並附加爲pdf內容。渲染和引導Laravel 4

$html = View::make('tpl',compact('aa','bb'))->render(); 

每當我添加的引導鏈接或刀片任何其他鏈接,

<head> 
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> 
</head> 

laravel會回到我這個錯誤:

Call to a member function append_child() on a non-object

爲什麼,以及如何解決這個問題?我使用Laravel 4.2

回答

0

嘗試以下:

$html = View::make('tpl',compact('aa','bb'))->__toString();

它會給你在字符串中的視圖

+0

同樣的錯誤返回。 – hahahaha

+0

你可以顯示你的佈局和tpl代碼嗎? –