Misago\ActionView\Helpers\UrlHelper

Functions:

current_page($url)

Checks wether the given URL is the current page or not.

Let's say we are visiting /products?order=asc:

current_page('/products')
# => true

current_page(array(':controller' => '/products'))
# => true

current_page(array(':controller' => '/products', ':action' => 'show'))
# => false

current_page(array(':controller' => '/products', 'order' => 'asc'))
# => true

current_page(array(':controller' => '/products', 'order' => 'desc'))
# => false 

button_to($name, $url, $attributes=null)

Generates a form with a single button that submits to the given URL.

Special attributes:

  • method - forces HTTP method
  • confirm - asks for JavaScript confirmation before submitting form

mail_to($email, $name=null, $options=null)

Generates a mailto link.

mail_to('me@domain.com');
# => <a href="mailto:me@domain.com">me@domain.com</a>

mail_to('me@domain.com', 'myself');
# => <a href="mailto:me@domain.com">myself</a>

mail_to('me@domain.com', 'another', array('class' => 'email'));
# => <a class="email" href="mailto:me@domain.com">another</a>