GO-V.ORG
As seen in

Open Power Template

Open Power Template is a web template engine written in PHP 5. A common strategy in designing web application is separation of the application logic (i.e. data processing) from the presentation (displaying the data). OPT is a tool for implementing such separation. The presentation layer is represented by templates, text files with HTML code and extra instructions controlling the data substitution. OPT uses a dedicated XML template language to write templates. It is not a general-purpose, but a domain-specific language. It was primarily designed to support and simplify template-specific problems with a set of declarative instructions. Instead of implementing the rendering algorithms and... Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.

Open Power Template is a web template engine written in PHP 5. A common strategy in designing web application is separation of the application logic (i.e. data processing) from the presentation (displaying the data). OPT is a tool for implementing such separation. The presentation layer is represented by templates, text files with HTML code and extra instructions controlling the data substitution. OPT uses a dedicated XML template language to write templates. It is not a general-purpose, but a domain-specific language. It was primarily designed to support and simplify template-specific problems with a set of declarative instructions. Instead of implementing the rendering algorithms and statements, like in imperative programming, the template designer specifies the expected result and features. This aims to ease the costs and efforts associated with software development and further maintenance. The library provides an object-oriented API based on the solutions from popular frameworks. As it is the first member of a bigger project, Open Power Libs, it is built upon a small OPL core library which provides the basic features. {$pageTitle} {$introduction} {$list.item} The second one generates the data and configures the library: require("./libs/Opl/Base.php"); Opl_Loader::setDirectory("./libs/"); Opl_Loader::register(); $tpl = new Opt_Class; $tpl->sourceDir = "./templates/"; $tpl->compileDir = "./templates_c/"; $tpl->setup(); $view = new Opt_View("template.tpl"); // Assigning the script data to the template $view->pageTitle = "Sample OPT page"; $view->introduction = "Sample text"; $view->list = array(0 => array("item" => "Item 1"), array("item" => "Item 1"), array("item" => "Item 1") ); $view->setFormat("list", "Array"); $output = new Opt_Output_Http; $output->render($view);

source: e01 Encyclopedia · licence: CC BY-SA 4.0 · page · source revision

Cite this

"Open Power Template". 1755000996. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1305516158

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·