2016-01-21 97 views
0
<div class="manga-created pull-right"> 
    <i class="fa fa-user"></i> 
    <small><?php echo $manga->user->username; ?>,</small> 
    <i class="fa fa-calendar-o"></i> 
    <small><?php echo App::make("HelperController")->formateCreationDate($manga->created_at); ?></small> 
</div> 

這裏這行是正在錯誤的非對象錯誤幫助屬性:因爲它看起來像一個$manga$manga->user想要知道的請

<small><?php echo $manga->user->username; ?>,</small> 
+2

是什麼'$ manga'?你能提供一個vardump嗎? – bansi

回答

1

是不是一個對象。因此,它應該像其中的一個:

<?php echo $manga->user['username']; ?> 

<?php echo $manga['user']->username; ?> 
+0

謝謝。 '<?php echo $ manga-> user ['username']; ?>訣竅。 – user5819198

+0

@ user5819198請接受答案,以便其他人知道問題已解決。 –