Created
September 2, 2012 17:40
-
-
Save adamfairholm/3602089 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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