| 1 | <?php  | 
            ||
| 11 | trait TitlePlaceholdersTrait  | 
            ||
| 12 | { | 
            ||
| 13 | |||
| 14 | /**  | 
            ||
| 15 | * Returns things to replace placeholders with.  | 
            ||
| 16 | * Must be an object so models can be easily walked to.  | 
            ||
| 17 | * For ease you can do return (object) [...];  | 
            ||
| 18 | *  | 
            ||
| 19 | * @return object  | 
            ||
| 20 | */  | 
            ||
| 21 | protected function getTitlePlaceholderReplaces()  | 
            ||
| 25 | |||
| 26 | /**  | 
            ||
| 27 | * Update page's title using placeholders  | 
            ||
| 28 | */  | 
            ||
| 29 | protected function updateTitle()  | 
            ||
| 35 | |||
| 36 | /**  | 
            ||
| 37 | * Replaces placeholders in title  | 
            ||
| 38 |      * Matches all {{rule}} placeholders, escaped @{{ blocks (w/ optional }}) | 
            ||
| 39 |      * Technically also matches "{{something" | 
            ||
| 40 | *  | 
            ||
| 41 | * @param $title string Title with placeholders  | 
            ||
| 42 | * @param $replacedWith object Things to replace with  | 
            ||
| 43 | *  | 
            ||
| 44 | * @return mixed  | 
            ||
| 45 | */  | 
            ||
| 46 | protected function replacePlaceholders($title, $replacedWith)  | 
            ||
| 63 | }  |