Go, Johnny, Go!

@param Controller $obj_controller
500890
public function dispatch(Controller $obj_controller)
    {
        $obj_controller->preDispatch();
        $obj_controller->dispatch();
        $obj_controller->postDispatch();
        $this->sendResponse($obj_controller->getResponse());
    }
469663
private function callControllerMethod(Controller $controller, $method)
    {
        return app()->call([$controller, $method], ParameterBag::getParameters());
    }
516593
private static function execController($controller,$action,$args){
        $controller = new $controller();
        $controller->doAction($action,$args);
    }
216060
function forward($controller_name, $action_name) {
        if ($this->execute($controller_name, $action_name) !== false) {
            \Hiano\View\View::display();
        }
        throw new StopException;
    }
1150894
def start(controller_class):
    
    args = parser.parse()
    obj = controller_class(args, platform.operating_system())
    if args.foreground:
        try:
            obj.start()
        except KeyboardInterrupt:
            obj.stop()
    else:
        try:
            with platform.Daemon(obj) as daemon:
                daemon.start()
        except (OSError, ValueError) as error:
            sys.stderr.write('\nError starting %s: %s\n\n' %
                             (sys.argv[0], error))
            sys.exit(1)
864756
function performAction($controller,$action,$queryString = null,$render = 0) {
		$controllerFile = ROOT . '/application/controllers/' . $controller . "controller.php";
		//print "Trying to load $controllerFile<br>";
		if (file_exists($controllerFile)){
			//print "File exists<br>";
			include_once($controllerFile);
		} else {
			throw new Exception("Controller file: $controllerFile does not exists");
		}
		$controllerName = ucfirst($controller).'Controller';
		$actionName= $action . 'Action'; // This is done to avoid clash with reserved function names like list();
		if (class_exists($controllerName)){
			
		} else {
			throw new Exception("ControllerClass: $controllerName does not exists");
		}

		//print "Trying to load $controllerName<br>"; 
		$dispatch = new $controllerName($controller, $action);
		$dispatch->render = $render;
		$dispatch->$actionName($queryString);

		if ($dispatch->render >0) {
				$dispatch->display();
		}

	}
130676
private function runController(): void
    {
        //get route information
        $action = $this->routeAction;
        $param = $this->routeParam;

        //action - call controller passing params
        if (!empty($param)) {
            \call_user_func_array([$this->controller, $action], $param);
            return;
        }

        //action - call controller
        if ($action) {
            \call_user_func([$this->controller, $action]);
        }
    }
1250257
private function _callControllerMethod()
    {
        $length = count($this->_url);

        // Make sure the method we are calling exists
        if ($length > 1) {
            if (!method_exists($this->_controller, $this->_url[1])) {
                $this->_error();
            }
        }

        // Determine what to load
        switch ($length) {
            case 5:
                //controller->Method(Param1, Param2, Param3)
                $this->_controller->{strtolower($this->_url[1])}(strtolower($this->_url[2], $this->_url[3], $this->_url[4]));
                break;

            case 4:
                //controller->Method(Param1, Param2)
                $this->_controller->{$this->_url[1]}($this->_url[2], $this->_url[3]);
                break;

            case 3:
                //Controller->Method(Param1, Param2)
                $this->_controller->{strtolower($this->_url[1])}(strtolower($this->_url[2]));
                break;

            case 2:
                //controller->Method(Param1, Param2)

                $this->_controller->{strtolower($this->_url[1])}();
                break;

            default:
//                $this->_controller->index();
                $this->_controller->index();

                break;
        }
    }
105459
public function bindToController()
    {
        if ($this->controller->widget === null) {
            $this->controller->widget = new stdClass;
        }

        $this->controller->widget->{$this->alias} = $this;
    }
651608
protected function _callControllerMethod() {

        // Make sure the controller we are calling exists
        if (!isset($this->_controller) || !is_object($this->_controller)) {
            $this->_error("Controller does not exist: " . $this->_url_controller);
            return false;
        }

        // Make sure the method we are calling exists
        if (!method_exists($this->_controller, $this->_url_method)) {
            $this->_error("Method does not exist: " . $this->_url_method);
            return false;
        }

        call_user_func_array(array($this->_controller, $this->_url_method), $this->_url_args);
    }
1371188
public function findController($controller)
    {
        $file = $this->basePath("app/Controller/$controller.php");
        if($this->findFile($file)) {
            return true;
        }
        else {
            throw new Exception($file." Controller file is missing.");
            exit;
        }
    }
923684
private function mapsController($controller, $uriapp = NULL, $method = NULL, $parentController = NULL){
        $httpMethod= isset($controller['httpMethod']) ? $controller['httpMethod'] : '*';
        if($parentController != NULL){
            $controller['url']= rtrim($parentController['url'], '/') . '/' . ltrim($controller['url'], '/');
        }
        $maps= UrlUri::mapsActualUrl($controller['url'], $uriapp) && UrlUri::mapsActualMethod($httpMethod, $method);
        if($maps){
            $mapController= array(
                'url' => $controller['url'],
                'httpMethod' => $httpMethod,
                'location' => isset($controller['location']) ? $controller['location'] : NULL,
                'namespace' => isset($controller['namespace']) ? $controller['namespace'] : NULL,
                'class' => isset($controller['class']) ? $controller['class'] : $parentController['class'],
                'method' => isset($controller['method']) ? $controller['method'] : NULL,
                'properties' => isset($controller['properties']) ? $controller['properties'] : array(),
                'middlewares' => isset($controller['middlewares']) ? $controller['middlewares'] : []
            );
            if($parentController != NULL){
                if(! isset($controller['class'])){
                    $mapController['location']= isset($parentController['location']) ? $parentController['location'] : NULL;
                    $mapController['namespace']= isset($parentController['namespace']) ? $parentController['namespace'] : NULL;
                }
                if(isset($parentController['properties'])){
                    $mapController['properties']= array_merge($parentController['properties'], $mapController['properties']);
                }
                if(isset($parentController['middlewares'])){
                    $mapController['middlewares'] = array_merge($parentController['middlewares'], $mapController['middlewares']);
                }
            }
            
            return $mapController;
        }else{
            return NULL;
        }
    }
663838
public function actionDelete($obj_type, $obj_id)
    {
        if (delete_favorite($obj_type, $obj_id)) {
            return $this->goBack(request()->referrer);
        } else {
            throw new ErrorException(\Yii::t('app', "Can't delete favorite"));
        }
    }
43070
public function autoload($controller,$action){
	
		$className = '\\magazine\\controller\\'.$controller;
		$controller = new $className($this->request);
		if(method_exists($controller,$action)){
			return  call_user_func([$controller, $action]);
		}
		return false;
	}
1126367
public function get(string $uri, string $controller, string $action)
    {
        $this->addRoute('GET', $uri, $controller, $action);
    }
741826
protected function parseLayer($objLayer)
    {
        $stringClass = $GLOBALS['con4gis']['stringClass'];
        $arrLayerData = [];
        $arrLayerData['id'] = $objLayer->id;
        $arrLayerData['pid'] = $objLayer->pid;
        $arrLayerData['name'] =  \Contao\Controller::replaceInsertTags($stringClass::decodeEntities($objLayer->name));
        $arrLayerData['zoom_locations'] = $objLayer->zoom_locations;
        $arrLayerData['async_content'] = $objLayer->async_content;
        $arrLayerData['noFilter'] = $objLayer->exemptFromFilter;
        $arrLayerData['locstyle'] = $objLayer->locstyle;
        
        if ($objLayer->cluster_locations) {
            $arrLayerData['cluster'] = [
                'distance' => $objLayer->cluster_distance,
                'fillcolor' => $objLayer->cluster_fillcolor,
                'fontcolor' => $objLayer->cluster_fontcolor,
                'zoom' => $objLayer->cluster_zoom,
                'popup' => $objLayer->cluster_popup
            ];
        }

        // check parent hide status
        $parentLayer = C4gMapsModel::findById($objLayer->pid);
        
        if (!$parentLayer->is_map && $parentLayer->data_hidelayer) {
            $arrLayerData['hide'] = $parentLayer->data_hidelayer;
        } else {
            $arrLayerData['hide'] = $objLayer->data_hidelayer;
        }

        if ($objLayer->loc_minzoom>0 || $objLayer->loc_maxzoom>0) {
            $arrLayerData['zoom'] = [
                'min' => $objLayer->loc_minzoom,
                'max' => $objLayer->loc_maxzoom,
                'onclick_to' => $objLayer->loc_onclick_zoomto
            ];
        }

        if ($objLayer->data_layername) {
            $arrLayerData['name'] = \Contao\Controller::replaceInsertTags($stringClass::decodeEntities($objLayer->data_layername));
            $arrLayerData['display'] = true;
            $arrLayerData['hide_child'] = $objLayer->hide_child;
        } else {
            $arrLayerData['display'] = false;
        }
        
        if ($objLayer->split_geojson) {
            $arrLayerData['split_geojson'] = $objLayer->split_geojson;
            $arrLayerData['geojson_attributes'] = $objLayer->geojson_attributes;
            $arrLayerData['geojson_zoom'] = $objLayer->geojson_zoom;
        }

        // hide when element is rendered in starboard tab
        if ($objLayer->hide_when_in_tab) {
            $arrLayerData['hide_when_in_tab'] = true;
        }

        $arrLayerData['type'] = $objLayer->location_type;
        if ($objLayer->location_type === 'link') {
            $arrLayerData = $this->handleLayerLink($objLayer, $arrLayerData);
        } else {
            $arrLayerData['content'] = $this->getContentForType($objLayer);
        }
        
        if ($objLayer->location_type === 'startab') {
            $arrLayerData['awesomeicon'] = $objLayer->awesomeicon;
        }
        
        $arrLayerData['raw'] = $objLayer;

        return $arrLayerData;
    }
897924
public static function ddp($obj = NULL)
	{
		try
		{
			$json_str = json_encode($obj, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
			echo $json_str;
			die();
		}
		catch(SangriaException $e)
		{
			/**
			 * Default to dd if there is an exception while encoding to JSON
			 */
			var_dump($obj);
			die();	
		}
	}