@param string $slug

@return string
542744
private function get_help_content( $slug ) {
		if ( empty( $slug ) ) {
			return '';
		}

		return $this->get_view( 'admin/help/' . $slug, $this->get_help_content_params(), false, false );
	}
56767
public function fetchBySlug($slug) {
        $select = $this->select()->where('slug = ?', $slug);
        return $this->fetchRow($select);
    }
898396
public static function load(string $slug)
    {
        $instance = new static();

        $instance->route = [];
        $instance->route['slug'] = $slug;
        $instance->route['groups'] = collect([]);

        return $instance;
    }
1292626
public static function slug(string $string): string
	{
		return rawurlencode(mb_strtolower(preg_replace('/\s{1,}/', '-', trim(preg_replace('/[\x0-\x1F\x21-\x2C\x2E-\x2F\x3A-\x40\x5B-\x60\x7B-\x7F]/', '', $string)))));
	}
377242
public static function get($slug)
    {
        $locale = I18n::getLocale();
        $slug = array_filter(explode('/', $slug));
        $cache = sprintf('page_%s_locale_%s', md5(serialize($slug)), $locale);
        $page = Cache::read($cache, 'static_pages');

        if (empty($page)) {
            //Sets the (partial) filename
            $filename = implode(DS, $slug);

            //Sets the filename patterns
            $patterns = [$filename . '-' . $locale];
            if (preg_match('/^(\w+)_\w+$/', $locale, $matches)) {
                $patterns[] = $filename . '-' . $matches[1];
            }
            $patterns[] = $filename;

            //Checks if the page exists in APP
            foreach ($patterns as $pattern) {
                $filename = self::getAppPath() . $pattern . '.ctp';

                if (is_readable($filename)) {
                    $page = DS . 'StaticPages' . DS . $pattern;

                    break;
                }
            }

            //Checks if the page exists in each plugin
            foreach (Plugin::all() as $plugin) {
                foreach ($patterns as $pattern) {
                    $filename = self::getPluginPath($plugin) . $pattern . '.ctp';

                    if (is_readable($filename)) {
                        $page = $plugin . '.' . DS . 'StaticPages' . DS . $pattern;

                        break;
                    }
                }
            }

            Cache::write($cache, $page, 'static_pages');
        }

        return $page;
    }
844385
protected function makeSlugUnique($slug)
    {
        $i = 1;
        $slugIsUnique = false;

        // get existing slugs (1 db query)
        $list = $this->getExistingSlugs($slug);

        // slug is already unique
        if ($list->count() === 0) {
            return $slug;
        }

        // collection to array
        if (!is_array($list)) {
            $list = $list->toArray();
        }

        // loop through the list and add suffix
        while (!$slugIsUnique) {
            $uniqueSlug = $slug . $this->slugOptions->slugSeparator . ($i++);
            if (!in_array($uniqueSlug, $list)) {
                $slugIsUnique = true;
            }
        }

        return $uniqueSlug;
    }
1114313
public function inGroup($slug)
    {
        return $this->groups->contains(function ($group) use ($slug) {
            return $group->slug === $slug || $group->id === $slug;
        });
    }
1270427
public static function humanize($slug)
    {
        $str = str_replace('-', ' ', $slug);
        $words = explode(' ', $str);
        $words = array_map('ucfirst', $words);
        return implode(' ', $words);
    }
754490
protected function getPackagePath($slug = null)
    {
        if (! is_null($slug)) {
            return $this->packages->getPackagePath($slug);
        }

        return $this->packages->getPackagesPath();
    }
1011040
public function prepareCanonicalURLForPersist($slug)
    {
        $baseURL = rtrim(config('app.url'), "/");

        if ($this->model->table == "posts") $type = "blog";


        // July 15, 2015: do *NOT* want type!

        //return $baseURL.'/'.$type.'/'.$slug;
        return $baseURL.'/'.$slug;
    }
208738
public static function getBySlug($slug)
    {
        $slug_parts = explode("-", $slug, 2);
        $class = get_called_class();
        $temp_this = new $class();
        $primary_key = $temp_this->getIDField();
        return self::search()->where($primary_key, $slug_parts[0])->execOne();
    }
899814
public function getThemePath($slug)
    {
        if (Str::length($slug) > 3) {
            $theme = Str::studly($slug);
        } else {
            $theme = Str::upper($slug);
        }

        return $this->getThemesPath() .DS .$theme .DS;
    }
150054
public function getModulePath($slug)
    {
        $module = studly_case($slug);

        if (\File::exists($this->getPath()."/{$module}/")) {
            return $this->getPath()."/{$module}/";
        }

        return $this->getPath()."/{$slug}/";
    }
34841
public function installedData(string $slug, string $key): string
    {
        if (!$slug || !$key) { // Either empty?
            return ''; // Not possible.
        }
        switch ($key) {
            case 'basename':
                $key = 'Basename';
                break;
            case 'name':
                $key = 'Name';
                break;
            case 'version':
                $key = 'Version';
                break;
            case 'description':
                $key = 'Description';
                break;
            case 'url':
                $key = 'PluginURI';
                break;
            case 'text_domain':
                $key = 'TextDomain';
                break;
            case 'author':
                $key = 'Author';
                break;
            case 'author_url':
                $key = 'AuthorURI';
                break;
            default: // Default case.
                return ''; // Unknown key.
        }
        $installed_plugins = $this->s::allInstalledPlugins(); // « Cached statically.
        return !empty($installed_plugins[$slug][$key]) ? (string) $installed_plugins[$slug][$key] : '';
    }
1257290
static function getBaseTheme( $slug ) {
		$filename = static::getCustomCssFolder() . sanitize_file_name( $slug . '.css' );
		if ( ! file_exists( $filename ) ) {
			return false;
		}
		$theme = get_file_data(
			$filename, [
				'ThemeURI' => 'Theme URI',
			]
		);
		$theme_slug = str_replace( [ 'http://pressbooks.com/themes/', 'https://pressbooks.com/themes/' ], [ '', '' ], $theme['ThemeURI'] );

		return untrailingslashit( $theme_slug );
	}
383816
public function block($slug)
    {
        $block = $this->findABlock($slug);

        if (!$block) {
            $this->update([
                'blocks' => json_encode(array_merge($this->blocks, [ $slug => '' ]))
            ]);
        }

        return $block;
    }
404565
public
    function index($slug)
    {

        $page = Model::getBySlug($slug);

        if (!$page)
            return response()->view("Jlib::errors.404")->setStatusCode(404);

        return response()->make($page);


    }