Runs the action.
This method displays the view requested by the user.
@param null $callback
180306
public function run($callback = null)
    {
        $fieldName = $this->inputName;
        $config = [
            'maxFiles' => 1,
            'extensions' => $this->getSetting('imageAllowFiles'),
            'checkExtensionByMimeType' => true,
            'mimeTypes' => 'image/*',
            "maxSize" => $this->getMaxUploadByte(),
        ];
        $uploader = new Uploader([
            'fileField' => $fieldName,
            'config' => $config,
        ]);
        $uploader->upFile();
        $res = $uploader->getFileInfo();
        if ($res['state'] == 'SUCCESS') {
            $result = [
                "originalName" => $res['original'],
                "name" => $res['title'],
                "url" => $res['url'],
                "size" => $res['size'],
                "type" => $res['type'],
                "state" => 'SUCCESS'
            ];
        } else {
            $result = [
                "state" => Yii::t('app', 'File save failed'),
            ];
        }

        if (is_null($callback)) {
            echo Json::encode($result);
        } else {
            echo '<script>' . $callback . '(' . Json::encode($result) . ')</script>';
        }
    }
1351364
public function run() {
			$this->execute();

			if ($handler = $this->getFormHandler(@$_REQUEST['_form_name']))
				call_user_func($handler, $_REQUEST);
		}
628679
public function run()
    {
        $view = $this->getView();

        $jsOptions = Json::encode([
            'id' => $this->id
        ]);

        $view->registerJs(<<<JS
        (function(sx, $, _)
        {
            sx.classes.FormUseTabs = sx.classes.Component.extend({

                _init: function()
                {
                    this.activeTab = window.location.hash.replace("#","");
                },

                _onDomReady: function()
                {
                    var self = this;

                    var JForm = $("#" + this.get('id'));
                    
                    var counter = 0;
                    $('.sx-form-tab').each(function(i,s)
                    {
                        counter = counter + 1;

                        var Jcontroll = $("<a>", {
                            'href' : '#' + $(this).attr('id'),
                            'aria-controls' : $(this).attr('id'),
                            'role' : 'tab',
                            'data-toggle' : 'tab',
                            'class' : 'nav-link',
                        }).append($(this).data('name'));

                        Jcontroll.on('click', function()
                        {
                            location.href = $(this).attr("href");
                        });

                        var Jli = $("<li>", {
                            'role' : 'presentation',
                            'class' : 'presentation nav-item',
                        }).append(Jcontroll);


                        if (self.activeTab)
                        {
                             if (self.activeTab == $(this).attr('id'))
                            {
                                Jli.addClass("active");
                                Jcontroll.addClass("active");
                                $(this).addClass("active");
                            }
                        } else
                        {
                            if (counter == 1)
                            {
                                Jli.addClass("active");
                                Jcontroll.addClass("active");
                                $(this).addClass("active");
                            }
                        }

                        $('.sx-form-tab-panel .nav').append(Jli);
                    });
                    
                    _.defer(function()
                    {
                        $('.sx-pre-loader-form', JForm).hide();
                        $('.sx-form-tab-panel', JForm).fadeIn();
                    });
                },
            });

            new sx.classes.FormUseTabs({$jsOptions});

        })(sx, sx.$, sx._);
JS
);

        $html = <<<HTML
            </div>
        </div>
HTML;

        return $html . parent::run();
    }
62983
public function run()
    {
        $this->run_called = true;
        $this->hook('beforeRender');
        $this->is_rendering = true;

        // if no App layout set
        if (!isset($this->html)) {
            throw new Exception(['App layout should be set.']);
        }

        $this->html->template->set('title', $this->title);
        $this->html->renderAll();
        $this->html->template->appendHTML('HEAD', $this->html->getJS());
        $this->is_rendering = false;
        $this->hook('beforeOutput');

        if (isset($_GET['__atk_callback']) && $this->catch_runaway_callbacks) {
            $this->terminate('!! Callback requested, but never reached. You may be missing some arguments in '.$_SERVER['REQUEST_URI']);
        }

        echo $this->html->template->render();
    }
785165
protected static function runCallback($callback, $args)
    {
        if (!is_array($args)) {
            $args = isset($args) ? array($args) : array();
        }
        return call_user_func_array($callback, $args);
    }
478026
public function render(callable $callback = null)
    {
        try {
            $contents = $this->renderContents();

            $response = isset($callback) ? call_user_func($callback, $this, $contents) : null;

            // Once we have the contents of the view, we will flush the sections if we are
            // done rendering all views so that there is nothing left hanging over when
            // another view gets rendered in the future by the application developer.
            $this->factory->flushStateIfDoneRendering();

            return ! is_null($response) ? $response : $contents;
        } catch (Exception $e) {
            $this->factory->flushState();

            throw $e;
        } catch (Throwable $e) {
            $this->factory->flushState();

            throw $e;
        }
    }
452077
public function listen(Closure $callback)
    {
        if (isset($this->events)) {
            $this->events->listen(Events\QueryExecuted::class, $callback);
        }
    }
136795
public function run()
    {
        $this->inputAttemptsUsed = 0;
        if ($this->executeBeforeRun !== null) {
            $callback = $this->executeBeforeRun;
            $callback($this);
        }
        for ($attempts = 0; $attempts < $this->totalAttemptsForInput; $attempts++) {
            $this->doInput();
            if ($this->wasCancelled()) {
                if ($this->cancelWithInputRetriesInput && $this->hasInput()) {
                    $this->logDebug("Cancelled input, retrying");
                    continue;
                }
                $this->logDebug("Cancelled node, quitting");
                break;
            }
            // dont play on last attempt by default
            if ($this->onNoInputMessage !== null
                && !$this->hasInput()
                && ($this->playOnNoInputInLastAttempt || $attempts != ($this->totalAttemptsForInput - 1))
            ) {
                $this->addPrePromptMessage($this->onNoInputMessage);
                continue;
            }
            if ($this->hasInput()) {
                if ($this->validate()) {
                    $this->logDebug("Input validated");
                    if ($this->executeOnValidInput !== null) {
                        $callback = $this->executeOnValidInput;
                        $this->beforeOnValidInput();
                        $callback($this);
                    }
                    break;
                } elseif ($this->executeAfterFailedValidation !== null) {
                    $callback = $this->executeAfterFailedValidation;
                    $callback($this);
                }
            }
        }
        $result = $this->playPrePromptMessages();
        if ($this->minInput > 0 && $attempts == $this->totalAttemptsForInput) {
            $this->logDebug("Max attempts reached");
            $this->state = self::STATE_MAX_INPUTS_REACHED;
            if ($this->onMaxValidInputAttempts !== null) {
                $this->callClientMethods(array(
                    array('streamFile' => array($this->onMaxValidInputAttempts, self::DTMF_ANY))
                ));
            }
        }
        if (!$this->isComplete() && $this->executeOnInputFailed !== null) {
            $callback = $this->executeOnInputFailed;
            $this->beforeOnInputFailed();
            $callback($this);
        }
        if ($this->executeAfterRun !== null) {
            $callback = $this->executeAfterRun;
            $callback($this);
        }

        $this->logDebug($this);
        return $this;
    }
706128
public function run()
    {
        if (empty($this->items)) {
            return null;
        }
        $this->renderLinks();
        $this->renderTemplate();
        $this->registerClientScript();
    }
1120166
public function run()
	{
		$this->style->getCharacter()->setIsBold(
			$this->parameter === null || (bool) $this->parameter
		);
		
		return;
	}
938219
public function render( callable $callback = null )
	{
		try
		{
			$contents = $this->renderContents();

			$response = isset( $callback ) ? call_user_func( $callback, $this, $contents ) : null;

			// Once we have the contents of the view, we will flush the sections if we are
			// done rendering all views so that there is nothing left hanging over when
			// another view gets rendered in the future by the application developer.
			$this->factory->flushSectionsIfDoneRendering();

			return !is_null( $response ) ? $response : $contents;
		}
		catch ( Exception $e )
		{
			$this->factory->flushSections();

			throw $e;
		}
		catch ( Throwable $e )
		{
			$this->factory->flushSections();

			throw $e;
		}
	}
958662
public function run()
    {
        try
        {
            $this['triggers']->callTrigger('before-match-request', $this);

            $this['request']->attributes->add(
                $this['router']->matchRequest($this['request'])
            );

            $this['triggers']->callTrigger('before-controller-resolver', $this);

            $this['response'] = $this->controllerResolver();
        }
        catch (ResourceNotFoundException $e)
        {
            $this['response'] = (new Controller($this))->serve404();
        }
        catch (\Exception $e)
        {
            $this['response'] = new Response();
            $this['response']->headers->set('Content-Type', 'text/plain');
            $this['response']->setStatusCode(Response::HTTP_INTERNAL_SERVER_ERROR);
            $this['response']->setContent($e->getMessage());
        }

        if ($this['x-frame-options']) {
            $this['response']->headers->set('x-frame-options', $this['x-frame-options']);
        }

        $this['response']->prepare($this['request']);

        $this['triggers']->callTrigger('before-send-response', $this);

        $this['response']->send();
    }
520100
public function run()
    {
        $this->addPending();
        $this->ran = true;

        while (count($this->inProcess) !== 0) {

            $this->monitorPending();
        }

        // Clear the references for callbacks.
        $this->onSuccess = null;
        $this->onError = null;
    }
1017520
public function render(Closure $callback = null)
    {
        try {
            $contents = $this->renderContents();

            $response = isset($callback) ? $callback($this, $contents) : null;

            // Once we have the contents of the view, we will flush the sections if we are
            // done rendering all views so that there is nothing left hanging over when
            // another view gets rendered in the future by the application developer.
            $this->factory->flushSectionsIfDoneRendering();

            return $response ?: $contents;
        } catch (Exception $e) {
            $this->factory->flushSections();

            throw $e;
        }
    }
1120858
public function execute($callback)
    {
        if (!$this->isBatch) {
            throw new \RuntimeException('Please batch json rpc first.');
        }
        $methods = $this->methods;
        $proxy = function ($err, $res) use ($methods, $callback) {
            if ($err !== null) {
                return call_user_func($callback, $err, null);
            }
            foreach ($methods as $key => $method) {
                if (isset($res[$key])) {
                    if (!is_array($res[$key])) {
                        $transformed = $method->transform([$res[$key]], $method->outputFormatters);
                        $res[$key] = $transformed[0];
                    } else {
                        $transformed = $method->transform($res[$key], $method->outputFormatters);
                        $res[$key] = $transformed;
                    }
                }
            }
            return call_user_func($callback, null, $res);
        };
        $this->requestManager->sendPayload('[' . implode(',', $this->batch) . ']', $proxy);
        $this->methods[] = [];
        $this->batch = [];
    }
175834
public function run()
	{
		echo $this->render($this->view,
			ArrayHelper::merge([
				'id' => $this->getId(),
				'url' => $this->url,
				'redirect' => $this->redirect,
			], $this->params)
		);
	}
522123
public function run()
    {
        // choosing which controller action must be executed
        $sAction = $this->_chooseCurrentAction();

        // executing action which returns name of template to render
        /** @var Controller $oController */
        $oController = $this->getInstance("Controller");

        $view = $oController->getView();
        $view->sendHeaders();

        try {
            $oController->$sAction();
        } catch (SetupControllerExitException $exception) {
        } finally {
            $view->display();
        }
    }