1
Hello, I wonder if there is a way to do via php what sublime text does with snippets. I need for example to replace a tag with a pre-formatted code. Type:
{{repete start}}
<div class="noticia">Conteúdo</div><br>
{{repete end}}
<!-- isso deverá ser interpretado como abaixo após acessado via web -->
<?php foreach ($noticias as $noticia): ?>
<?= $noticia['texto'] ?><br>
<?php endforeach ?>
<!-- que no output ficará -->
Conteúdo
Conteúdo
Conteúdo
Conteúdo
Conteúdo
(quantos existirem no banco)
Is it possible to do this using php? My idea is to facilitate the work of integrators who use a php admin panel that the company uses. Thank you very much.
It’s not very clear what you want to do. What exactly is the relationship between the 3 code snippets?
– Woss
The first is the tag I want to "create", to say that that block will repeat itself. The second block is the PHP that he should run when processing this on the page and the third block is the output in html of what he presents of this query (taking into account that the database and select query of the table I’m already doing above that).
– Fábio Duarte
It’s not that simple. What would have the
repete start
? How would he know it was the news table? And how would he know that the content inside the div was acampo
of the table and referring to the repeat start ?– Isac
yes has how and even use in my Framework. I can give an idea of how to do.
– Daniel 101