Source Code
if ($this->request->method() === 'POST')
{
$url = $this->request->post('url');
if ( ! filter_var($url, FILTER_VALIDATE_URL))
{
// Not a valid URL
$response = 'Invalid URL.';
}
else
{
// Generate the standard v3 UUID for this URL
$uuid = UUID::v3(UUID::URL, $url);
// Set the response
$response = Debug::vars($uuid);
}
}
else
{
$url = 'http://';
}
$this->content = View::factory('demo/form')
->set('message', 'Enter a URL to generate a v3 (md5) UUID.')
->set('inputs', array(
'URL' => Form::input('url', $url),
))
->bind('footer', $response)
;