Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
7 / 7 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| AppView | |
100.00% |
7 / 7 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| initialize | |
100.00% |
6 / 6 |
|
100.00% |
1 / 1 |
1 | |||
| makeHumanReadable | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | declare(strict_types=1); |
| 3 | |
| 4 | /** |
| 5 | * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) |
| 6 | * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) |
| 7 | * |
| 8 | * Licensed under The MIT License |
| 9 | * Redistributions of files must retain the above copyright notice. |
| 10 | * |
| 11 | * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) |
| 12 | * @link https://cakephp.org CakePHP(tm) Project |
| 13 | * @since 3.0.0 |
| 14 | * @license https://opensource.org/licenses/mit-license.php MIT License |
| 15 | */ |
| 16 | namespace App\View; |
| 17 | |
| 18 | use Cake\Utility\Inflector; |
| 19 | use Cake\View\View; |
| 20 | |
| 21 | /** |
| 22 | * Application View |
| 23 | * |
| 24 | * Your application's default view class |
| 25 | * |
| 26 | * @link https://book.cakephp.org/4/en/views.html#the-app-view |
| 27 | */ |
| 28 | class AppView extends View |
| 29 | { |
| 30 | /** |
| 31 | * Initialization hook method. |
| 32 | * |
| 33 | * Use this method to add common initialization code like adding helpers. |
| 34 | * |
| 35 | * e.g. `$this->addHelper('Html');` |
| 36 | * |
| 37 | * @return void |
| 38 | */ |
| 39 | public function initialize(): void |
| 40 | { |
| 41 | $this->loadHelper('Authentication.Identity'); |
| 42 | $this->loadHelper('Video'); |
| 43 | $this->addHelper('Gallery'); |
| 44 | $this->addHelper('Content'); |
| 45 | |
| 46 | // Load DefaultTheme helpers (available when plugin is loaded) |
| 47 | $this->loadHelper('DefaultTheme.MetaTags'); |
| 48 | $this->loadHelper('DefaultTheme.Navigation'); |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * Converts a string to a human-readable format. |
| 53 | * |
| 54 | * This method takes a string, converts it to underscore format, |
| 55 | * and then humanizes it for better readability. |
| 56 | * |
| 57 | * @param string $string The input string to be converted |
| 58 | * @return string The humanized and readable version of the input string |
| 59 | */ |
| 60 | public function makeHumanReadable(string $string): string |
| 61 | { |
| 62 | return Inflector::humanize(Inflector::underscore($string)); |
| 63 | } |
| 64 | } |