| Conditions | 5 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | public function render() |
||
| 29 | { |
||
| 30 | $iface = '\Aimeos\MW\View\Iface'; |
||
| 31 | $view = $this->templateVariableContainer->get( '_aimeos_view' ); |
||
| 32 | |||
| 33 | if( !is_object( $view ) || !( $view instanceof $iface ) ) { |
||
| 34 | throw new Exception( 'Aimeos view object is missing' ); |
||
| 35 | } |
||
| 36 | |||
| 37 | if( !isset( $this->arguments['key'] ) ) { |
||
| 38 | throw new Exception( 'Attribute "key" missing for Aimeos translate view helper' ); |
||
| 39 | } |
||
| 40 | |||
| 41 | $key = $this->arguments['key']; |
||
| 42 | $default = ( isset( $this->arguments['default'] ) ? $this->arguments['default'] : null ); |
||
| 43 | |||
| 44 | return $view->config( $key, $default ); |
||
| 45 | } |
||
| 46 | } |