Exception:Array
(
[message] => Call to undefined function Vvveb\Plugins\Seo\Modules\Breadcrumbs\mb_substr()
[file] => /home/www/vvveb/demo/plugins/seo/modules/breadcrumbs/breadcrumbs.php
[line_no] => 42
[line] => $item = ['@type' => 'ListItem', 'position' => $pos++, 'name' => mb_substr(strip_tags((string)($crumb['name'] ?? '')), 0, 200)]; // <==
[lines] => Array
(
[0] => *
[1] => * @param array $trail
[2] => */
[3] => public static function crumbs(array $trail): array {
[4] => $out = [];
[5] => $pos = 1;
[6] => foreach ($trail as $crumb) {
[7] => $item = ['@type' => 'ListItem', 'position' => $pos++, 'name' => mb_substr(strip_tags((string)($crumb['name'] ?? '')), 0, 200)]; // <==
[8] => if (!empty($crumb['url'])) {
[9] => $item['item'] = $crumb['url'];
[10] => }
[11] => $out[] = $item;
[12] => }
[13] =>
)
[trace] => #0 /home/www/vvveb/demo/plugins/seo/modules/breadcrumbs/breadcrumbs.php(54): Vvveb\Plugins\Seo\Modules\Breadcrumbs\Breadcrumbs::crumbs()
#1 /home/www/vvveb/demo/plugins/seo/modules/breadcrumbs/breadcrumbs.php(66): Vvveb\Plugins\Seo\Modules\Breadcrumbs\Breadcrumbs::jsonLd()
#2 /home/www/vvveb/demo/plugins/seo/modules/breadcrumbs/breadcrumbs.php(93): Vvveb\Plugins\Seo\Modules\Breadcrumbs\Breadcrumbs->emit()
#3 /home/www/vvveb/demo/system/event.php(77): Vvveb\Plugins\Seo\Modules\Breadcrumbs\Breadcrumbs->taxonomy()
#4 /home/www/vvveb/demo/app/controller/content/category.php(80): Vvveb\System\Event::trigger()
#5 [internal function]: Vvveb\Controller\Content\Category->index()
#6 /home/www/vvveb/demo/system/core/frontcontroller.php(256): call_user_func()
#7 /home/www/vvveb/demo/system/core/frontcontroller.php(327): Vvveb\System\Core\FrontController::call()
#8 /home/www/vvveb/demo/system/core/frontcontroller.php(401): Vvveb\System\Core\FrontController::redirect()
#9 /home/www/vvveb/demo/system/core/startup.php(518): Vvveb\System\Core\FrontController::dispatch()
#10 /home/www/vvveb/demo/index.php(122): Vvveb\System\Core\start()
#11 /home/www/vvveb/demo/index.php(168): Vvveb\saveCache()
#12 /home/www/vvveb/demo/public/index.php(28): include('...')
#13 {main}
[code] => Array
(
[0] =>
[2] => namespace Vvveb\Plugins\Seo\Modules\Breadcrumbs;
[3] =>
[4] => use Vvveb\System\Core\View;
[5] => use Vvveb\System\Event;
[6] =>
[7] => if (!defined('V_VERSION')) {
[8] => exit('Invalid request!');
[9] => }
[10] =>
[11] => /**
[12] => * Breadcrumbs: BreadcrumbList JSON-LD + view vars for themes.
[13] => * Listens on the same content events as Seo\App so trails match the page.
[14] => */
[15] => class Breadcrumbs {
[16] => public function app(): void {
[17] => Event::on('Vvveb\Controller\Content\Post', 'index:after', __CLASS__, [$this, 'post'], 2000);
[18] => Event::on('Vvveb\Controller\Content\Page', 'index:after', __CLASS__, [$this, 'post'], 2000);
[19] => Event::on('Vvveb\Controller\Product\Product', 'index:after', __CLASS__, [$this, 'product'], 2000);
[20] => Event::on('Vvveb\Controller\Content\Category', 'index:after', __CLASS__, [$this, 'taxonomy'], 2000);
[21] => Event::on('Vvveb\Controller\Product\Category', 'index:after', __CLASS__, [$this, 'taxonomy'], 2000);
[22] => }
[23] =>
[24] => public static function baseUrl(): string {
[25] => if (class_exists('\Vvveb\Plugins\Seo\Modules\Sitemap\Sitemap')) {
[26] => return \Vvveb\Plugins\Seo\Modules\Sitemap\Sitemap::baseUrl();
[27] => }
[28] => $scheme = \Vvveb\isSecure() ? 'https' : 'http';
[29] =>
[30] => return rtrim($scheme . '://' . SITE_URL . V_SUBDIR_INSTALL . SITE_PATH, '/');
[31] => }
[32] =>
[33] => /**
[34] => * Build ordered crumbs: each [name, url|null].
[35] => *
[36] => * @param array $trail
[37] => */
[38] => public static function crumbs(array $trail): array {
[39] => $out = [];
[40] => $pos = 1;
[41] => foreach ($trail as $crumb) {
[42] => $item = ['@type' => 'ListItem', 'position' => $pos++, 'name' => mb_substr(strip_tags((string)($crumb['name'] ?? '')), 0, 200)]; // <==
[43] => if (!empty($crumb['url'])) {
[44] => $item['item'] = $crumb['url'];
[45] => }
[46] => $out[] = $item;
[47] => }
[48] =>
[49] => return $out;
[50] => }
[51] =>
[52] => public static function jsonLd(array $trail): ?string {
[53] => $items = self::crumbs($trail);
[54] => if (count($items) < 2) {
[55] => return null;
[56] => }
[57] =>
[58] => return json_encode(['@context' => 'https://schema.org', '@type' => 'BreadcrumbList', 'itemListElement' => $items], JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT);
[59] => }
[60] =>
[61] => protected function emit(array $trail): void {
[62] => $view = View::getInstance();
[63] => $view->seo ??= [];
[64] => $view->breadcrumbs = $trail;
[65] => if ($json = self::jsonLd($trail)) {
[66] => $view->seo['schema']['breadcrumbs'] = $json;
[67] => }
[68] => }
[69] =>
[70] => public function post($content, $languageContent, $language, $slug) {
[71] => $post = $content[$language] ?? [];
[72] => if (!empty($post['name'])) {
[73] => $base = self::baseUrl();
[74] => $this->emit([['name' => 'Home', 'url' => $base . '/'], ['name' => $post['name'], 'url' => null]]);
[75] => }
[76] =>
[77] => return [$content, $languageContent, $language, $slug];
[78] => }
[79] =>
[80] => public function product($content, $languageContent, $language, $slug) {
[81] => return $this->post($content, $languageContent, $language, $slug);
[82] => }
[83] =>
[84] => public function taxonomy($taxonomy, $type) {
[85] => if (!empty($taxonomy['name'])) {
[86] => $base = self::baseUrl();
[87] => $trail = [['name' => 'Home', 'url' => $base . '/']];
[88] => if (!empty($taxonomy['parent_name'])) {
[89] => $trail[] = ['name' => $taxonomy['parent_name'], 'url' => null];
[90] => }
[91] => $trail[] = ['name' => $taxonomy['name'], 'url' => null];
[92] => $this->emit($trail);
[93] => }
[94] =>
[95] => return [$taxonomy, $type];
[96] => }
[97] => }
)
)