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

python - how we can use ajax() in views.py in django? -

matlab - Using loops to get multiple values into a cell -

python - Sequence Pattern recognition with Pybrain -