This repository has been archived on 2024-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
Sequenzia/lib/Rails/Panel/helpers/ApplicationHelper.php

14 lines
538 B
PHP
Raw Normal View History

2013-10-02 18:14:53 +02:00
<?php
class ApplicationHelper extends Rails\ActionView\Helper
{
public function linkTo($link, $url_params, array $attrs = array())
{
if ($url_params == 'root') {
return $this->base()->linkTo($link, $url_params, $attrs);
} else {
$base_path = Rails::application()->router()->basePath();
$attrs['href'] = $base_path . '/' . Rails::application()->config()->rails_panel_path . '/' . substr($url_params, 1);
return $this->contentTag('a', $link, $attrs);
}
}
}