G
G
Glebster132019-08-16 20:21:53
Laravel
Glebster13, 2019-08-16 20:21:53

How does the Blade templating engine work?

Good day, gentlemen developers. Relatively recently I found my first job in IT. Remote work, small team. We use laravel , php , js . We make a website builder for sales. I'm in charge of design. Everything is bad with the backend. Of the skills - html, css, bs4, well, js at the level of working with the DOM.
So, closer to the point. when trying to style one of the pages of the project, there was a problem of misunderstanding of some @section, @show, @extends , etc. Later it turned out that these are attributes of the Blade template engine.. I read the documentation, I understood the principle of operation. But this is only on paper. In reality, changing the content within a section (even just changing the text in the link) does not change anything.
I will explain using the project menu as an example.
I have a views folder . It has a templates folder that contains funnels.blade.php .
In this file, the @extends attribute (correct me if I'm calling it wrong) "calls" layout_clientpage.blade.php , which is located in the layouts folder . After changing the link text of one of the buttons from "Monitor" to "Monitor 1", nothing changed. The menu on the local server still shows "Monitor" . I would understand if I erased something superfluous, but I can’t even change the text in the link. Explain to the neophyte what he is doing wrong.
I don't want to lose my first job :(

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sanes, 2019-08-16
@Sanes

Similar to the work of other template engines. For example, on Fenom in Modx The
paths to the files are separated by a dot relative to views
. It's also useful to clear the cache after the update.

A
antimind, 2019-08-16
@antimind

Try php artisan view:clearto clear the template cache.

I
Igor Vorotnev, 2019-08-17
@HeadOnFire

1. If you are in charge of design, then you have nothing to do in blade templates. Backenders and frontenders can hang out there, but not designers.
2. Template engines work in such a way that the templates themselves are then compiled into a regular php / html code and cached. This cache is used to render the page (this improves performance). Now, if you changed the template, but did not clear the cache, you will not see the changes.
3. To clear the cache, as antimind already wrote, you need to run the php artisan view:clear command in the console at the root of the project

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question