Created
October 3, 2012 15:49
-
-
Save joshtronic/3827705 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Prepare Variables | |
* | |
* Processes the request variable and creates all the variables that the | |
* Controller needs to load the page. | |
* | |
* @param string $basename the requested page | |
* @return array the resulting variables | |
*/ | |
public function prepareVariables($basename) | |
{ | |
// Sets up all of our variables | |
$module_class = strtr($basename, '/', '_'); | |
$module_filename = SITE_MODULE_PATH . $basename . '.php'; | |
$template_basename = $basename; | |
$css_class = $module_class; | |
$js_basename = $basename; | |
// Scrubs class names with hyphens | |
if (strpos($module_class, '-') !== false) | |
{ | |
$module_class = preg_replace('/(-(.{1}))/e', 'strtoupper("$2")', $module_class); | |
} | |
return array($module_class, $module_filename, $template_basename, $css_class, $js_basename); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment