Skip to content

Instantly share code, notes, and snippets.

View objectivehtml's full-sized avatar

Justin Kimbrell objectivehtml

  • Woodland Park, CO
View GitHub Profile
@objectivehtml
objectivehtml / gist:1478635
Created December 14, 2011 21:29
A better way to fetch EE parameters
private function param($param, $default = FALSE, $boolean = FALSE, $required = FALSE)
{
$name = $param;
$param = $this->EE->TMPL->fetch_param($param);
if($required && !$param) show_error('You must define a "'.$name.'" parameter in the '.__CLASS__.' tag.');
if($param === FALSE && $default !== FALSE)
{
$param = $default;
@objectivehtml
objectivehtml / gist:1333617
Created November 2, 2011 13:25
New Channel Data API
Overview
--------
The idea here is to have a single "library" (in this case it's actually a driver)
that loads an API from _other_ add-ons.
For instance, say you wanted you application to interact with Google Maps for
ExpressionEngine, but you want to do it in a nice easy to use fashion without loading
a whole bunch of dependencies and reverse engineer someone's code. With an effort to
eliminate duplicate code and make life easier for all developers, we can now use