best way for dividing dynamic(php) content from static content(html) for web design?

247
March 16, 2017, at 01:25 AM

Until this day I have been using notepad++ for website developing. my codes are like:

... 
<div><?php
$han=mysql_query("Blah blah ...");
$row=mysql_fetch_array($han);
// and so many codes to process text ..
echo $something;
?></div>
...

But maintenance of this kind of code is really hard. Now I see that everything is changing on webdesign. Everybody is going to make their websites responsive. I wish I could change my html code without seeing dynamic codes.

for example think I have have html file like this(static.html):

<div>#{content_here}</div>

and also a separate php file like this:

<?
$static_content=file_get_contents("static.html");
$han=mysql_query("Blah blah ...");
$row=mysql_fetch_array($han);
// and so many codes to process text ..
$content_here=$something;
echo str_replace("#{content_here}",$content_here,$static_content);
?>

This way I can separate static content from dynamic content. But this is all my innovation. And every time I invent something then I find that there is even a better and more extensive thing already invented.

So is there already IDEs that support this kind of web development? possibly get contents generated by php in json format and then blend it with Html content.

READ ALSO
scopeMethods not found in controller PhpStorm Laravel 5 [duplicate]

scopeMethods not found in controller PhpStorm Laravel 5 [duplicate]

This question already has an answer here:

579
Symfony: find entities from user and friends with single DQL query

Symfony: find entities from user and friends with single DQL query

I want to get all entities from the type Observation that are owned by a user and the friends of the userI have made the following function in my EntityRepository

286
Inheriting properties yet changing their name in child

Inheriting properties yet changing their name in child

I have a class for products with properties - title, url, price, currency, description etcI query different stores who call these properties with different names

193
How to use geoNear with the current PHP MongoDB Driver?

How to use geoNear with the current PHP MongoDB Driver?

I'm currently working with the current PHP MongoDB\Driver

545