About Laravel - How to use function string in view

610 views Asked by At

i try to to show data from database article...the content is contain html tags and long text.. so i want make a read more and convert tag html to html view..

this is my code is run :

{{ HTML::decode($show->content) }}
{{ str_limit($show->content, $limit=100, $end=' ...') }}

i try this :

{{ HTML::decode(str_limit($show->content,$limit=100, $end=' ...')) }}
{{ str_limit(HTML::decode($show->content),$limit=100, $end=' ...') }}

but not show ( blank )

annyone can help me to fix it??

thank u b4

1

There are 1 answers

3
smgladkovskiy On

Is {{ $show->content }} returning any data to format?

Is your template is .blade?

Maybe it placed somewhere in HTML, where it is not visible?

Try to use this construction with some predefined string to find out if it works. Here is working example:

{{ str_limit('Some big text', $limit = 5, $end='...') }}