ZF2 TinyUrl is a Zend Framework 2 module that provides youtube-or-tinyurl features.
- Zend Framework 2 (latest master)
-
Add this project in your composer.json:
"require": { "noc-med/zf2-tinyurl": "dev-master" }
-
Now tell composer to download ZF2 TinyUrl by running the command:
$ php composer.phar update
-
Enabling it in your
application.config.php
file.<?php return array( 'modules' => array( // ... 'NocMed\TinyUrl', ), // ... );
-
Call TinyUrl with the service manager
/* @var $serviceManager \Zend\ServiceManager\ServiceLocatorInterface */ $tinyUrl = $serviceManager->get('noc-med.tinyurl'); $tinyUrl->alphaID(907492350932095432); // received bfcuhKfMqt4
-
Call TinyUrl in a view
$tinyUrl = $this->plugin('noc-med.tinyurl'); $tinyUrl->alphaID(907492350932095432); // received bfcuhKfMqt4