【发布时间】:2018-06-12 04:42:32
【问题描述】:
我的 Laravel 网站主页中有一个 About Us 部分。我从管理面板为About Us 上传了一篇巨大的文章,显示在about us 页面中。但我想在主页中显示about us 的特定数量的单词,然后在之后添加read more。当点击read more 时,它会转到about us 页面。
但我无法在我的主页上显示该文章的具体字数。
我使用了echo word_teaser_end($about_us[0]->details, 10); 函数但它给出了错误
Call to undefined function word_teaser_end() (View: E:\xampp\htdocs\OFFICE\SEN_CARE\sencare.com.bd\resources\views\frontend\home\home.blade.php)
我现在该怎么办?
【问题讨论】:
-
显然函数没有定义。如果在任何地方,你在哪里定义它?
-
检查 str_limit($about_us[0]->details,'10')
-
在代码中搜索函数
word_teaser_end。这是在任何地方定义的吗? -
@Lovepreet Singh .....我在我的 laravel 刀片模板中使用了这个功能。
-
问题不在于你在哪里使用它,而在于你在哪里定义它。
标签: php html laravel-5.5