aboutsummaryrefslogtreecommitdiffstats
path: root/core/namespace/Application.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/namespace/Application.php')
-rw-r--r--core/namespace/Application.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/namespace/Application.php b/core/namespace/Application.php
index 2329253..5690841 100644
--- a/core/namespace/Application.php
+++ b/core/namespace/Application.php
@@ -141,6 +141,13 @@ class Application {
}
#===============================================================================
+ # Return absolute category URL
+ #===============================================================================
+ public static function getCategoryURL($more = ''): string {
+ return self::getURL(self::get('CATEGORY.DIRECTORY')."/{$more}");
+ }
+
+ #===============================================================================
# Return absolute post URL
#===============================================================================
public static function getPostURL($more = ''): string {
@@ -188,6 +195,9 @@ class Application {
#===============================================================================
public static function getEntityURL(EntityInterface $Entity) {
switch($class = get_class($Entity)) {
+ case 'ORM\Entities\Category':
+ $attr = self::get('CATEGORY.SLUG_URLS') ? 'slug' : 'id';
+ return self::getCategoryURL($Entity->get($attr).'/');
case 'ORM\Entities\Page':
$attr = self::get('PAGE.SLUG_URLS') ? 'slug' : 'id';
return self::getPageURL($Entity->get($attr).'/');