/mvc/elements/shorturl
[return to app]1
<?php
2 echo $form->open();
3 echo $html->div($form->input(array('name' => 'url', 'label' => 'URL', 'class' => 'wideinput', 'value' =>
'http://',
4 'maxlength' => 765)));
5 echo $html->div($form->input(array('type' => 'submit', 'value' => 'Generate short URL')));
6 echo $form->close();
7 if (isset($_POST['shortUrl'])) {
8 $baseUrl = 'http://' . get::$config->SITE_DOMAIN . '/' . mvc::$controller . '/';
9 if (mvc::$action != 'index') {
10 $baseUrl .= mvc::$action . '/';
11 }
12 echo $html->h2('Short URL: ' . $html->link($baseUrl . get::htmlentities($_POST['shortUrl'])));
13 }