Skip to content

Instantly share code, notes, and snippets.

@victorstanciu
Created October 9, 2012 09:52
Show Gist options
  • Save victorstanciu/3857702 to your computer and use it in GitHub Desktop.
Save victorstanciu/3857702 to your computer and use it in GitHub Desktop.
public function getURL()
{
if (Nip_Request::instance()->module == 'admin') {
$arguments = func_get_args();
return parent::__call('getURL', $arguments);
}
return $this->getPublicURL();
}
public function getPublicURL()
{
return Articles::instance()->getViewURL(array(
"module" => "default",
"id" => $this->id,
"show" => $this->URL()->encode($this->getShow()->name),
"slug" => substr($this->URL()->encode(html_entity_decode($this->title, ENT_QUOTES, 'UTF-8')), 0, 255)
));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment