\Charcoal\ObjectRoutableInterface

Defines an object as routable.

Routable objects are accessible via a URI. The interface provides a "slug" property to track the latest "pretty" URI path.

Available implementation as trait:

Summary

Methods
Constants
setSlugPattern()
slugPattern()
setSlug()
slug()
generateSlug()
url()
createRouteObject()
objectRouteClass()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

setSlugPattern()

setSlugPattern(mixed  $pattern) : \Charcoal\Object\RoutableInterface

Set the object's URL slug pattern.

Parameters

mixed $pattern

The slug pattern.

Returns

\Charcoal\Object\RoutableInterface

Chainable

slugPattern()

slugPattern() : string|null

Retrieve the object's URL slug pattern.

Returns

string|null

setSlug()

setSlug(mixed  $slug) : \Charcoal\Object\RoutableInterface

Set the object's URL slug.

Parameters

mixed $slug

The slug.

Returns

\Charcoal\Object\RoutableInterface

Chainable

slug()

slug() : string|null

Retrieve the object's URL slug.

Returns

string|null

generateSlug()

generateSlug() : string|null

Generate a URL slug from the object's URL slug pattern.

Returns

string|null

url()

url() : string|null

Retrieve the object's URI.

Returns

string|null

objectRouteClass()

objectRouteClass() : string

Retrieve the class name of the object route model.

Returns

string