Skip to content

Instantly share code, notes, and snippets.

{
"server": {
"name": "Server 1",
"url": "http://server1.whatevs.com"
}
}
<?
$config=Config::Get('db');
<?
class HasAccessScreen extends Screen
{
public function before($controller,$metadata,&$data)
{
// make sure we have a valid user id from current session
if (!$uid=$controller->session->id)
throw new InvalidParametersException();
// fetch the forum ID
<?
class StatsScreen extends Screen
{
private $start;
public function before($controller,$metadata,&$data)
{
$this->start=microtime(true);
}
before:
has_profile: { ignore: true }
has_access: { ignore: true }
before:
has_profile: {}
has_access: { to: 'forums.forum', key: 'forum_id' }
stats: {}
after:
stats: {}
<?
/**
* [[
* before:
* has_profile: {}
* has_access: { to: 'forum' }
* stats: {}
* after:
* stats: {}
* ]]
<?
class PostController extends Controller
{
public function setup()
{
$this->ignored[]='dont_call_me';
}
public function dont_call_me()
{
<?
class PostController extends Controller
{
public function index($post_id)
{
if (is_numeric($post_id))
{
$post=Model::Instance('blog.post',$post_id);
if ($post)
{
<?
class PostController extends Controller
{
/**
* [[
* view: 'post/edit'
* ]]
*/
public function create()
{