Skip to content

Instantly share code, notes, and snippets.

@adamfairholm
Created September 2, 2012 17:40
Show Gist options
  • Select an option

  • Save adamfairholm/3602089 to your computer and use it in GitHub Desktop.

Select an option

Save adamfairholm/3602089 to your computer and use it in GitHub Desktop.
public function chunk()
{
$chunk = $this->db
->where('page_id', $this->attribute('id'))
->where('slug', $this->attribute('name'))
->get('page_chunks')
->row_array();
if ($chunk)
{
if ($this->content())
{
return $chunk;
}
else
{
$to_parse = ($chunk['type'] == 'markdown') ? $chunk['parsed'] : $chunk['body'];
$parser = new Lex_Parser();
$parser->scope_glue(':');
return $parser->parse($to_parse, array(), array($this->parser, 'parser_callback'));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment