You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 21, 2021. It is now read-only.
*Well-Engineered for Templating. Uses no template syntaxes!*[ox-harris.github.io/phpfront](https://ox-harris.github.io/phpfront)
3
2
4
-
-----------------------------------------------
3
+
PHPFront will help you read/write content on HTML templates from within your PHP application, read/write on attributes, traverse up/down the full document, manipulate - create, repeat, import, relocate, replace, remove - elements dynamically, produce a clean HTML output that represents your entire application. This is server-side rendering.
5
4
6
-
PHPFront is a fully-featured template engine for PHP.
7
-
It facilitates the globally-held standard of code separation in application building.
8
-
It helps you dynamically render application content on templates without mixing application codes (PHP) with presentation codes (HTML).
9
-
10
-
* This code separation brings about cleaner and more maintainable code - the same reason why you do not mix CSS styles with HTML.
11
-
* And on the critical side, you avoid all the security issues associated with using PHP codes on HTML templates.
12
-
13
-
Furthermore, PHPFront brings all the ease and fun to your code, and a whole lot of new possibilities!
14
-
15
-
**Compare PHPFront with Smarty and other Text-based Template Engines**
16
-
17
-
* No template syntaxes - not even one. PHPFront is DOM-based not text-based.
18
-
* Requires no proprietary syntaxes, PHP codes, or the .tpl extension on templates.
19
-
* Built around familiar standards and conventions: PHP, HTML, CSS, XPATH.
5
+
It implements the JQuery API with its powerful CSS3 selectors and chainable methods. It is well-tested and greatly optimized for use in websites and other PHP-based applications; built with love to bring all the ease and fun to your code, and a whole lot of new possibilities!
20
6
21
7
# Installation
22
8
## Requirement
@@ -59,19 +45,6 @@ Then in your app.php:
59
45
```php
60
46
$PHPFront = new PHPFront;
61
47
```
62
-
63
-
* Now we can start assigning content to the respective elements in the template using PHPFront’s `assign()` function
64
-
65
-
```php
66
-
// For document title (title)
67
-
$PHPFront->assign(‘title’, ‘This is document title’);
68
-
69
-
// For page heading 1 (h1)
70
-
$PHPFront->assign(‘h1’, ‘Hello World!’);
71
-
72
-
// For page paragraph (p)
73
-
$PHPFront->assign(‘p’, ‘Here is my first PHPFront project’);
74
-
```
75
48
76
49
* Now, we hand PHPFront the template to use - our template.html page
77
50
```php
@@ -81,7 +54,24 @@ Then in your app.php:
81
54
// Where ‘path-to-template is your actual path to where you stored template.html
## The differences (lest you think they're the same all the way):
241
-
242
-
Smarty
243
-
244
-
* A smarty template is not a standard HTML markup. But a mix of HTML and Smarty's own tags and syntaxes.
245
-
*`Smarty::assign()` assigns data to template variables, and you pick up those variables on the template to manually render or loop over.
246
-
* A Smarty template file has the file extension .tpl. not .html
247
-
* You must learn PHP, HTML and Smarty syntaxes to work with Smarty.
248
-
249
-
PHPFront
250
-
251
-
* Any valid HTML markup is a template! And valid HTML markup is valid anywhere - with or without the PHPFront Engine!
252
-
*`PHPFront::assign()` assigns data directly to elements in a template. No extra overhead of editing the template using template syntaxes to render or loop over.
253
-
* Template file extension is rightly .html
254
-
* PHPFront requires no other language. (You've learned PHP and HTML already! And that's all! That's the standard.)
255
-
256
-
Furthermore, if you know CSS, you can even target template elements by
0 commit comments