php - Laravel develop Blade template Engine -


I want to use custom code in the blade template engine such as the use for custom functions

My Function:

  Public Function ViewDate ($ Arg = 0) {Return 'date is'.date (' y '); }   

Blade templates with this code in use

  @ < How to develop blades for custom actions   

P> Add to filter.fp file
  blade :: extension (function ($ view) {return str_replace ("@ dateY", 'date is'.date (' y '), $ view) ;});   

In the template:

  & lt; H1 & gt; @ DateY & lt; / H1>   

Full tutorial about blade extensions here:

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -