Skip to content

Commit dfa9341

Browse files
committed
Add category url path
1 parent 95c3395 commit dfa9341

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Model/Category.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,14 @@ public function getDynamicData($fields = null)
522522
$data['category_level'] = $this->getLevel();
523523
}
524524

525+
if (is_array($fields) && array_key_exists('posts_count', $fields)) {
526+
$data['posts_count'] = $this->getPostsCount();
527+
}
528+
529+
if (is_array($fields) && array_key_exists('category_url_path', $fields)) {
530+
$data['category_url_path'] = $this->getUrl();
531+
}
532+
525533
return $data;
526534
}
527535

0 commit comments

Comments
 (0)