Let pages have a code behind class.
A shortlink generator and twitter example is included.
Version: preview
- css parser
- xml parser
- po file parser
- renderer
- shortlink generator example
- simple twitter clone example
- simple contact management example
- PHP 7.2 and above
- Apache with mod_rewrite
- Samples requires the sqlite extension enabled on php
Doesnt support media queries
Only supports valid xml
This doenst work:
<link rel="stylesheet" href="x">
This works:
<link rel="stylesheet" href="x"/>
- simple one line msgid, msgstr
- multiline msgid, msgstr
- collects comments, comments references, comments flags, comments extracted in a translation
- contexts
- plural definitions
In the html page you place for example
<?codeBehind class="\Controller\Index" ?>
at the top of the html.
The classes get_execute
will be called before outputing the html.
You can for example manipulate the html before its sent to the browser.
You put a html page page.html
in the app/controller/pages
folder.
The file will be available at https://localhost/page.html
or alternative https://localhost/page
You can add a onclick event on nodes
Example:
$h4s = $renderer->document->getElementsByTagName('h4');
$h4s[0]->addEventListener('click','test');
The method "test" will be called in the code behind class.
Signature:
bool test($renderer,Request $request,Response $response);
If you return false
in the method theres no redirection back to
the page.
You can add ajax events on nodes
Example:
$retweet = $renderer->document->getElementById('retweet' . $row['id']);
$retweet->addEventListener('ajaxClick','retweet');
// ajax usage in the twitter example
The method "retweet" will be called in the code behind class.
Signature:
mixed retweet($renderer,AjaxRequest $request,AjaxResponse $response);