ShortUrl module

1 Introduction

This module provides the ability to generate and use short URLs for pages and files in the Dynamic Content Repository. Short URLs can be generated with the module or the CreateShortUrlWidget.

2 Configuration

'modules' => array(
    'shorturl' => array(
        'class' => 'common.modules.shorturl.ShortUrlModule',
        'conversionBase' => 36

2.1 Module attributes

2.1.1 conversionBase

The object ID part of the objects content ID will be transformed to another base.

The highest base number you can configure is 36 (This is the highest PHP supports). Example: “99213” will be converted to “24jx”

2.2 UrlManager route

The default route that maps to shorturl/shortUrl/redirect can be changed in the rules configuration of the UrlManager component.

3 ShortUrlModule

The module itself provides various public methods for short URLs. Open the file for a list of available methods and documentation.

4 CreateShortUrlWidget

Creates a short URL to another page or file.

4.1 Parameters

  • contentId – The content ID of the CMS object
  • params – An array of GET parameters to append

<?php echo $this->widget('shorturl.widgets.CreateShortUrlWidget',array('contentId' => '10007.123', 'params' => array('getparam' => '123')), true); ?>