File manager - Edit - /home/opticamezl/www/newok/templates/yootheme/packages/view/src/View/StrHelper.php
Back
<?php namespace YOOtheme\View; use YOOtheme\Str; use YOOtheme\View; class StrHelper extends Str { /** * Constructor. * * @param View $view */ public function __construct(View $view) { $functions = [ // native 'trim' => 'trim', 'json' => 'json_encode', 'nl2br' => 'nl2br', 'striptags' => 'strip_tags', // date 'date' => [$this, 'date'], // string util 'limit' => [$this, 'limit'], 'words' => [$this, 'words'], 'upper' => [$this, 'upper'], 'lower' => [$this, 'lower'], 'title' => [$this, 'titleCase'], ]; foreach ($functions as $name => $function) { $view->addFunction($name, $function); } } /** * Formats a date. * * @param mixed $date * @param string $format * * @return string */ public function date($date, $format = 'F j, Y H:i') { if (is_string($date)) { $date = strtotime($date); } elseif ($date instanceof \DateTime) { $date = $date->getTimestamp(); } return date($format, $date); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.23 | Generation time: 0 |
proxy
|
phpinfo
|
Settings