noc-med / zf2-tinyurl
dev-master
2015-07-04 16:55 UTC
Requires
- php: >=5.3.3
- zendframework/zendframework: 2.*@stable
This package is not auto-updated.
Last update: 2024-09-24 03:08:08 UTC
README
介绍
ZF2 TinyUrl 是一个提供类似 YouTube 或 TinyUrl 功能的 Zend Framework 2 模块。更多详情。
要求
- Zend Framework 2 (最新master版本)
安装
主要设置
使用 composer
-
在您的 composer.json 中添加此项目
"require": { "noc-med/zf2-tinyurl": "dev-master" }
-
现在运行以下命令,让 composer 下载 ZF2 TinyUrl:
$ php composer.phar update
安装后
-
在您的
application.config.php
文件中启用它。<?php return array( 'modules' => array( // ... 'NocMed\TinyUrl', ), // ... );
如何使用 ZF2 TinyUrl
-
通过服务管理器调用 TinyUrl
/* @var $serviceManager \Zend\ServiceManager\ServiceLocatorInterface */ $tinyUrl = $serviceManager->get('noc-med.tinyurl'); $tinyUrl->alphaID(907492350932095432); // received bfcuhKfMqt4
-
在视图中调用 TinyUrl
$tinyUrl = $this->plugin('noc-med.tinyurl'); $tinyUrl->alphaID(907492350932095432); // received bfcuhKfMqt4