Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rhildred/phpassetchain
Underscore style templates on LAMP Servers
https://github.com/rhildred/phpassetchain
Last synced: 13 days ago
JSON representation
Underscore style templates on LAMP Servers
- Host: GitHub
- URL: https://github.com/rhildred/phpassetchain
- Owner: rhildred
- Created: 2014-05-19T14:08:07.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-29T21:04:50.000Z (about 10 years ago)
- Last Synced: 2024-04-14T14:03:14.606Z (9 months ago)
- Language: PHP
- Size: 609 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
PHP templates + API with SEO friendly URI
==========================================In my html classes I introduced the DRY principle. The first time I did this with server side includes.
The second time with underscore style templates that rendered a layout and body server side with node.js.
Node.js is offered by a lot of hosts, but not nearly as many as offer LAMP.
LAMP also gives me the possibility of having a more WebMatrix like Database helper using PDO instead of
mysql2 that I used on node.js.Basically we have .phtml templates that look something like this:
So There!
The layout is intended to have all of the menu and common elements in it. The `renderBody()` like this:Rich was here,
Produces output like thisRich was here,
So There!
There is also a restful api associated with this. Given a class:result = "success";
return $rc;
}
}
in `lib/classes/controllers/PingController.php` surfing to `http://localhost/~rhildred/phpassetchain/public/api/Ping`
will produce `{"result":"success"}`