in reply to Re^4: Here documents in blocks
in thread Here documents in blocks
There are more techniques like "includes", were sub-templates are integrated which have sub-templates and so on.
Or embedding programming code inside the HTML for loops or conditional snippets.
And there is reusability, like hacking once a generic "table" template and applying it to different projects.
I have to admit all of this can also be done with pure Perl and no regexing at all, thanks to it's flexibility.
But a framework has a lot of benefits in a team, for instance I don't have teach my colleagues a bunch of best practices if there is already a well documented trail to do it.
Separated HTML-code is not only easier to edit - if it's well done the browser can display it , my editor can highlight it properly and formatting, validation and indentation is easy.
Last but not least, isolated HTML code can be handled by a web specialist without any knowledge of the controlling programming langue, much like SQL-Statements don't need expertise in Perl. That's the main idea of the MVC pattern.
Example from another perspective ... You've spend much time criticizing the design of the monastery, but it's a monolithic framework in pure Perl written 20 years ago.
We can't simply ask several design expert to overhaul the templates, because a lot of HTML is interspersed inside Perl code. (actually it's even much more complicated, because many people added parts in the past)
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Here documents in blocks (why templates)
by Bod (Parson) on Dec 20, 2020 at 23:33 UTC | |
by marto (Cardinal) on Dec 21, 2020 at 09:51 UTC | |
by LanX (Saint) on Dec 21, 2020 at 15:04 UTC | |
by marto (Cardinal) on Dec 21, 2020 at 18:49 UTC | |
by Bod (Parson) on Dec 21, 2020 at 10:56 UTC | |
by marto (Cardinal) on Dec 21, 2020 at 12:09 UTC | |
by Bod (Parson) on Dec 21, 2020 at 17:35 UTC | |
| |
by LanX (Saint) on Dec 21, 2020 at 14:37 UTC |