This repository was archived by the owner on Dec 8, 2022. It is now read-only.
forked from mako-framework/framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Learn more: Url helper
Marco Montalbano edited this page Jul 31, 2017
·
1 revision
The URL helper contains methods for generating Mako URLs.
The to method will return a Mako URL to the chosen route.
// Will print http://example.org/foo/bar
echo URL::to('foo/bar');
// Will print http://example.org/foo/bar?key=value&key2=value2
echo URL::to('foo/bar', array('key1' => 'value1', 'key2' => 'value2'));
The current method will return the current URL of the main request.
// Visiting http://example.org/foo/bar will print http://example.org/foo/bar
echo URL::current();
// Visiting http://example.org/foo/bar/baz will print http://example.org/foo/bar/baz
echo URL::current();
The matches method returns TRUE if the current URL matches the pattern and false if not.
// Basic URL matching
if(URL::matches('news'))
{
}
// You can also use regular expressions to match URLs
if(URL::matches('news/article/([0-9]+)'))
{
}
- Getting started: Installation
- Getting started: Configuration
- Getting started: Error handling
- Getting started: Constants
- Getting started: Coding standards
- Controllers: Controllers
- Controllers: Request
- Controllers: Response
- Databases: Basics
- Databases: Query builder
- Databases: Orm
- Databases: Migrations
- Command line: Basics
- Command line: Custom tasks
- Packages: Basics
- Packages: Composer packages
- Learn more: Array helper
- Learn more: Asset manager
- Learn more: Autoloading
- Learn more: Caching
- Learn more: Cookies
- Learn more: Events
- Learn more: File helper
- Learn more: Html helper
- Learn more: Internationalization
- Learn more: Logging
- Learn more: Number helper
- Learn more: Pagination
- Learn more: Redis client
- Learn more: Rest client
- Learn more: Security helpers
- Learn more: Sessions
- Learn more: String helper
- Learn more: Url helper
- Learn more: Uuid helper
- Learn more: Validation
- Learn more: Views