Skip to content

Instantly share code, notes, and snippets.

@shakyShane
Created July 22, 2012 09:43
Show Gist options
  • Save shakyShane/3159082 to your computer and use it in GitHub Desktop.
Save shakyShane/3159082 to your computer and use it in GitHub Desktop.
Convert a 'route' into a page title
<?php
/**
* Convert a 'route' into a page title.
*
* @static
* @param $route
* @return string
*
*/
public static function setTitle($route){
$defaultTitle = 'Shane Osbourne - Web Developer';
if ($route){
$title = $route . ' - ' . $defaultTitle;
return $title;
} else
return $defaultTitle;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment