All about 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.
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.
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.
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.
As in most programming languages, Simphple has the typical conditional structures (if, elseif, else, switch y case)
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.
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.
Write the value of a variable in the html code.
<div><?php echo $variable1; ?></div>
Another method more simple:
Add arithmetic operations in the html code.
<div><?php echo 3*2+$var1, $var2; ?></div>
Add functions in the html code.
<div><?php echo func1('data1', $var1); ?></div>