HTML is the basis for creating any page and in many situations it is necessary to render it at runtime. This means that at any given time it needs to be written the extent to which the code is running.

Rendering HTML in PHP

To make it clearer that kind of situation, an example will be shown in sequence:


function returnlink(){

return ‘<a >Scriptcase</a>’





<div><?php returnsLinks()  ?></div>




In the example, a link is rendered inside a div from a PHP method. In a simple way, it is possible to understand the working logic in more complex situations. A link can be rendered, as well as any other elements such as a selection list or button.

Now, using logic, a second example will be presented:


function returnslist ($reg){

$lst = ‘<ul>’;

for ($i = 1; $i <= $reg; $i++)


$lst = $lst .'<li>’.$i.'</li>’;


$lst = $lst.'</ul>’;

                return $lst;





<div><?php returnsList (10)  ?></div>




In the example, a sequential list according to the reported number of records in the method call is rendered. The exit code of our example will be:













This type of logic can be used, for example, to traverse an array with data loaded from a query in the database.

You might also like…

Scriptcase uses the MVC template?

Maybe you might have thought about this at some point, “Scriptcase uses the MVC templates?" Well, ...

How to implement A2F using Own Development in NodeJS in a Scriptcase application

A2F using Own Development in NodeJS A2F: In a previous article, we talked about Swivel as an extern...

Specialists or generalists, who gets a better advantage by using Scriptcase?

Hey there! Today  we will figure what are the ideal profiles for those who wish to take advantage o...

Comment this post

Get new posts, resources, offers and more each week.

We will use the information you provide to update you about our Newsletter and Special Offers. You can unsubscribe any time you want by clinck in a link in the footer of any email you receive from us, or by contacting us at Learn more about our Privacy Police.