Skip to content

Instantly share code, notes, and snippets.

@Awilum
Last active February 18, 2021 08:03
Show Gist options
  • Save Awilum/1851713 to your computer and use it in GitHub Desktop.
Save Awilum/1851713 to your computer and use it in GitHub Desktop.
Atweet PHP Framework - in less that 140 bytes
require(__DIR__.'/c.php');
if(($a=!empty($_GET['r'])?$_GET['r']:'index')&&(!is_callable($a)||substr($a,0,1)=='_'))die("Ooops...");
$a();
<?php
function index() {
echo 'main index action';
}
function test() {
echo 'action test';
}
function _test() {
echo 'protected action';
}
<?php
include 'atweet.php';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment