| Date: | 2009-10-11 20:48:52 (5 months 7 days ago) |
|---|---|
| Author: | Loïc d'Anterroches |
| Commit: | 3b49fd0e960195d65f359358e6d404207e2d7e0c |
| Message: | Improved the speed to get an index from the context object. |
| Files: |
src/Pluf/Template/ContextVars.php (1 diff) |
Change Details
| src/Pluf/Template/ContextVars.php | ||
|---|---|---|
| 26 | 26 | */ |
| 27 | 27 | class Pluf_Template_ContextVars extends ArrayObject |
| 28 | 28 | { |
| 29 | function offsetGet($prop) | |
| 30 | { | |
| 31 | try { | |
| 32 | return parent::offsetGet($prop); | |
| 33 | } catch (Exception $e) { | |
| 34 | return ''; | |
| 35 | } | |
| 36 | } | |
| 37 | ||
| 38 | 29 | function __get($prop) |
| 39 | 30 | { |
| 40 | return $this->offsetGet($prop); | |
| 31 | return (isset($this[$prop])) ? $this[$prop] : ''; | |
| 41 | 32 | } |
| 42 | ||
| 33 | ||
| 43 | 34 | function __toString() |
| 44 | 35 | { |
| 45 | 36 | return var_export($this, true); |
