Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
zoghal committed Apr 20, 2015
1 parent db3943c commit aebca15
Showing 1 changed file with 15 additions and 29 deletions.
44 changes: 15 additions & 29 deletions src/View/View.php
Expand Up @@ -36,33 +36,7 @@ public function __construct(Request $request = null, Response $response = null,
}





/**
* View::_getRequestNameID()
*
* @return
*/
protected function _getRequestNameID(){
$out = [];



$name = $this->request->param('plugin');
if($name){

$name = str_replace('/','',$name);
$out['plugin'] = $name ;
}

$name = $this->request->param('controller');
$out['controller'] = ucfirst($name) ;
$name = $this->request->param('action');
$out['action'] = ucfirst($name);
return $out;
}




/**
Expand All @@ -71,8 +45,20 @@ protected function _getRequestNameID(){
* @return
*/
public function getLayoutID(){
$out = $this->_getRequestNameID();
$out = '';
extract($this->request->params);

if ($prefix) {
$out .= ucfirst($prefix).'-' ;
}

if ($plugin) {
$out .= ucfirst($plugin) ;
}

$out .= ucfirst($controller);
$out .= ucfirst($action);

return 'Page-' . $out['controller'] . $out['action'];
return $out;
}
}

0 comments on commit aebca15

Please sign in to comment.