/**
*
*
* @param $SliceName
* @param array $Arguments
* @return Gdn_Slice
*/
public function slice($SliceName, $Arguments = array())
{
$CurrentPath = Gdn::request()->path();
$ExplodedPath = explode('/', $CurrentPath);
switch ($this instanceof Gdn_IPlugin) {
case true:
$ReplacementIndex = 2;
break;
case false:
$ReplacementIndex = 1;
break;
}
if ($ExplodedPath[0] == strtolower(Gdn::dispatcher()->application()) && $ExplodedPath[1] == strtolower(Gdn::dispatcher()->controller())) {
$ReplacementIndex++;
}
$ExplodedPath[$ReplacementIndex] = $SliceName;
$SlicePath = implode('/', $ExplodedPath);
return Gdn::Slice($SlicePath);
}