All about Simphple

What is Simphple?

what is simphple Inspired in the MVC model, Simphple is a framework that allows separating the business logic from data presentation in a simple y elegant.

One of the problems for the developers is to combine the data of the php code with the web code (html, xml, css, javascript ...). The most common way to solve the problem is join the php language and the web language, both intertwined, in the same file. That is write the php code and add between, for example, html tags. This has numerous disadvantages and the result is a large file where php and html mixed confusedly. Simphple allows the developer to create separately Site code and php code and then mix the two in a simple way, thus facilitating the task.

Features

Powerfull language and similar to php

Simphple allows the use of structures, variables, arithmetic/logics operations, constants, methods and functions of php, etc.. In addition the similarity to the grammar of php is high. This makes it easy for web developers learning.

Great compatibility

Simphple Framework supports PHP versions greater than or equal to 5.0.0. and not need any php external library. It has been tested on versions 5.0.0, 5.1.0, 5.2.2 and 5.3.0 of php.

Include structure

It has a structure that allows add templates within other templates. Additionally templates can be parameterized to make them more useful and versatile. This allows the web developer reuse the html code.

Conditional structures

As in most programming languages, Simphple ​​has the typical conditional structures (if, elseif, else, switch y case)

loop structures

It has a loop structure which allows to repeat the html code php with different data, simplifying the repetitive parts on the web pages.

Simphple also has break and continue structures to facilitate and improve the use of loops.

Separate cache system

Simphple also has a cache that can store the results of the templates that have been analyzed This reduces the execution time in Simphple because the code does not compile again, Simphple only extracts the code stored in the cache. Moreover, the system cache can be used externally to store other data for later use.

Error handler

Simphple detects and reports errors and warnings occurring in the templates. Also it allows use a custom function for handle the errors and display a custom web message.

Comparison syntax

Write the value of a variable in the html code.

Php language
<div><?php echo $variable1?></div>
Simphple language
<div>{$variable1:}</div>

Another method more simple:
<div>$variable1</div>

Add arithmetic operations in the html code.

Php language
<div><?php echo 3*2+$var1$var2?></div>
Simphple language
<div>{3*2+$var1$var2:}</div>

Add functions in the html code.

Php language
<div><?php echo func1('data1'$var1); ?></div>
Simphple language
<div>{func1('data1'$var1):}</div>