I'm trying to write a package that needs access to Uri segments.
When I use
\Uri::segment(1)
For example, it runs the segment function but errors saying:
ErrorException [ Error ]: Call to a member function get_segment() on a non-object
On this line:
return \Request::active()->uri->get_segment($segment, $default);
Is this because request hasn't been loaded, and how can I get this to run?
With thanks in advance