<?php
namespace controls;
class Site
{
  public static function route()
  {
    global $user;

    $class = '\controls\\';

    $results = explode( '_', \S::get( 'module' ) );
    if ( is_array( $results ) ) foreach ( $results as $row )
      $class .= ucfirst( $row );

    $action = \S::get( 'action' );

    if ( class_exists( $class ) and method_exists( new $class, $action ) )
    {
      return call_user_func_array( array( $class, $action ), array() );
    }
  }
}
