<?php

namespace Meramo\Pagemanager\Utils;

class Utilities
{
    /**
     * Create category from slug
     *
     */

    public function createCategoryFromSlug($slug)
    {
        if (substr($slug, 0, 1) === '/') $value = ltrim($slug, '/');

        if (substr($slug, 0, 1) === '_') $value = ltrim($slug, '_');

        #TODO: $value is probably undefined. So please define a 'default'!
        return  explode('/', $value)[0];
    }
}