mardi 17 janvier 2017

How do i execute multiple lines of PHP code in blade?

I have the following 2 lines of code in my blade template:

<p>
    <?php preg_match('/<p>(.*?)<\/p>/i' , $recent->blog_content , $matches) ?>
    {!! str_limit($matches[0] , 50 , '...') !!}
</p>

Now how do i write the first like of code I.E. the below line of code:

<?php preg_match('/<p>(.*?)<\/p>/i' , $recent->blog_content , $matches) ?>

In blade as both the below two syntaxs , outputs the result to the frontEnd instead of execute my code:




{!! preg_match('/<p>(.*?)<\/p>/i' , $recent->blog_content , $matches) !!}

Basically how do i execute multiple lines of PHP code in blade ?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2iGZt6R
via IFTTT

Aucun commentaire:

Enregistrer un commentaire