Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 21 lines (18 sloc) 0.492 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
<?php
class Generic_Controller {
public function __invoke() {
$args = func_get_args();
if (method_exists($this,$args[0]))
if (!isset($args[1]))
$args[1] = null;
return $this->{$args[0]}($args[1]);
}

public function format_date($date) {
return date('d.m.Y H:i',strtotime($date));
}

public function truncate($string,$chars) {
list($new_string) = explode("\n", wordwrap(strip_tags($string), $chars, "\n", false));
return $new_string.'...';
}
}
?>
Something went wrong with that request. Please try again.