Execute the job.
$templateId 模板消息ID
$url  链接
$data   模板数据
@return void
557014
public function handle()
    {
        if(env("IS_SEND")){

            //将发送模板消息添加到队列
            try {

                $result = $this->notice->uses($this->templateId)->withUrl($this->url)->andData($this->data)->andReceiver($this->openid)->send();
                Log::info("向".$this->openid ."发送模板消息 地址".$this->url);
                new  Exception($result);
            } catch (Exception $e) {
                echo json_encode(array(
                    "errcode" => $e->getCode(),
                    "errmsg" => $e->getMessage(),
                ));
            }


        }


    }
911075
public function execute()
    {
        $model = new \Gems_Model_TemplateModel('templates', $this->project);
        $templates = $model->load();
        foreach ($templates as $name => $data) {
            // Now load individual template
            $data = $model->load(array('name'=> $name));
            // And save
            $model->save(reset($data));
        }
    }
303909
public function fire()
    {
        $path = $this->getPath();
        $className = basename($path, '.php');
        $template = $this->option('template');

        $this->printResult($this->generator->make($path, $template), $path);

        if ($this->generator->updateDatabaseSeederRunMethod($className))
        {
            $this->info('Updated ' . app_path() . '/database/seeds/DatabaseSeeder.php');
        }
        else
        {
            $this->comment('Did not need to update ' . app_path() . '/database/seeds/DatabaseSeeder.php');
        }


    }
87462
public function run()
	{
		$id=$this->getId();
		if(isset($this->htmlOptions['id']))
			$id=$this->htmlOptions['id'];
		else
			$this->htmlOptions['id']=$id;

		echo CHtml::openTag($this->tagName,$this->htmlOptions);
		echo CHtml::closeTag($this->tagName);

		$this->options['value']=$this->value;
		$options=CJavaScript::encode($this->options);
		Yii::app()->getClientScript()->registerScript(__CLASS__.'#'.$id,"jQuery('#{$id}').progressbar($options);");
	}
1086794
public function handle()
    {

        // setup for crud

        $this->modelName = $this->formatModel($this->argument('ModelName'));

        $this->slug = $this->argument('Slug');



        $this->setCrudTokens();


        $this->setFilePaths();



        // setup for views

        $this->setConfigFromInputs();


        // runs all commands

        if  ($this->makeCrudFiles() &&
             $this->makeViewDirectory()->makeViewFiles($this->templateType)){

            $this->sendSuccessMessage();

            return;

        }


        $this->error('Oops, something went wrong!');


    }
1049943
public function execute()
    {
        if (!empty($this->args[1])) {
            $this->args[0] .= "', '".str_replace('\'', '"', $this->args[1]);
        }

        HTML\Generator::call(
            'script',
            array(
                str_replace(':UA:', $this->args[0], self::JS)
            ),
            array(
                'compress',
                'inlineInner',
                'noCache'
            )
        );
    }
1070041
public function run()
    {
        $this->registerClientScript();

        if ($this->hasModel()) {
            $input = Html::activeHiddenInput($this->model, $this->attribute, $this->options);
        } else {
            $input = Html::hiddenInput($this->name, $this->value, $this->options);
        }

        echo strtr($this->template, [
            '{input}' => $input,
            '{jstree}' => Html::tag('div', '', ['id' => $this->getJsTreeId()]),
        ]);
    }
380916
protected function setApplyData()
    {
        if (!isset($this->job)) {
            throw new \InvalidArgumentException('cannot create a viewModel for Templates without a $job');
        }
        
        $data = [
            'applyId' => $this->job->getApplyId(),
            'uri' => null,
            'oneClickProfiles' => []
        ];
        $atsMode = $this->job->getAtsMode();
        
        if ($atsMode->isIntern() || $atsMode->isEmail()) {
            $data['uri'] = $this->urlPlugin->fromRoute('lang/apply', ['applyId' => $this->job->getApplyId()], ['force_canonical' => true]);
        } elseif ($atsMode->isUri()) {
            $data['uri'] = $atsMode->getUri();
        }
        
        if ($atsMode->isIntern() && $atsMode->getOneClickApply()) {
            $data['oneClickProfiles'] = $atsMode->getOneClickApplyProfiles();
        }
        
        $this->container['applyData'] = $data;
        
        return $this;
    }
395410
public function execute() {
        global $DB, $CFG;

        require_once($CFG->dirroot . '/auth/mnet/auth.php');
        $mnetplugin = new \auth_plugin_mnet();
        $mnetplugin->keepalive_client();

        $random100 = rand(0,100);
        if ($random100 < 10) {
            $longtime = time() - DAYSECS;
            $DB->delete_records_select('mnet_session', "expires < ?", [$longtime]);
        }
    }
295344
protected function job(): void
    {
        $corporation = $this->retrieve([
            'corporation_id' => $this->getCorporationId(),
        ]);

        if ($corporation->isCachedLoad()) return;

        CorporationInfo::firstOrNew([
            'corporation_id' => $this->getCorporationId(),
        ])->fill([
            'name'            => $corporation->name,
            'ticker'          => $corporation->ticker,
            'member_count'    => $corporation->member_count,
            'ceo_id'          => $corporation->ceo_id,
            'alliance_id'     => $corporation->alliance_id ?? null,
            'description'     => $corporation->description ?? null,
            'tax_rate'        => $corporation->tax_rate,
            'date_founded'    => property_exists($corporation, 'date_founded') ?
                carbon($corporation->date_founded) : null,
            'creator_id'      => $corporation->creator_id,
            'url'             => $corporation->url ?? null,
            'faction_id'      => $corporation->faction_id ?? null,
            'home_station_id' => $corporation->home_station_id ?? null,
            'shares'          => $corporation->shares ?? null,
        ])->save();
    }
564148
public function run() {
		
		$id = $this->htmlOptions['id'];

		echo CHtml::openTag('div', $this->htmlOptions);

		foreach ($this->alerts as $type => $alert) {

			if (is_string($alert)) {
				$type = $alert;
				$alert = array();
			}

			if (isset($alert['visible']) && $alert['visible'] === false) {
				continue;
			}

			/** @var CWebUser $userComponent */
			$userComponent = Yii::app()->getComponent($this->userComponentId);
			if (!$userComponent->hasFlash($type))
				continue;

			$alertText = $userComponent->getFlash($type);
            if (empty($alertText)) { // null, ''
                continue;
            }

			$this->renderSingleAlert($alert, $type, $alertText);
		}

		echo CHtml::closeTag('div');

		$id .= '_' . self::$_containerId++;
		$selector = "#{$id} .alert";

		/** @var CClientScript $cs */
		$cs = Yii::app()->getClientScript();
		$cs->registerScript(__CLASS__ . '#' . $id, "jQuery('{$selector}').alert();");

		foreach ($this->events as $name => $handler) {
			$handler = CJavaScript::encode($handler);
			$cs->registerScript(
				__CLASS__ . '#' . $id . '_' . $name,
				"jQuery('{$selector}').on('{$name}', {$handler});"
			);
		}
	}
1169358
public static function run($url = null, $data = null, $method = 'GET') {
        if ($url) {
            if (is_string($data)) {
                $method = $data;
                $data   = null;
            }
            $method                 = strtoupper($method);
            $_SERVER['REQUEST_URI'] = $url;
            $query                  = @parse_url($url, PHP_URL_QUERY);
            if ($query) {
                $args = [];
                parse_str($query, $args);
                if ($args) {
                    if ($data) {
                        $data = array_merge($data, $args);
                    } else {
                        $data = $args;
                    }
                }
            }
            $_SERVER['REQUEST_METHOD'] = $method;
            if ($data) {
                if ($method == 'GET') {
                    $_SERVER['QUERY_STRING'] = http_build_query($data);
                }
                Request::getInstance()->addUserData($data);
            }

            $_SERVER['REQUEST_TIME'] = time();
        }
        if (!isset ($_SERVER ['REQUEST_URI'])) {
            Response::respond(500, 'Your web server did not provide REQUEST_URI, stop route request.');
        }

        if (!self::$app->router) {
            self::$app->router = Router::getRouter();
        }
        try {
            return self::$app->router->route();
        } catch (\Exception $e) {
            if (defined('DEBUG') && DEBUG < DEBUG_ERROR) {
                show_exception_page($e);
            } else {
                Response::respond(500, $e->getMessage());
            }
        }

        return false;
    }
229995
public function _run()
	{
		echo $this->_engine->get(
			$this->getTemplateFile(func_get_arg(0)),
			$this->getDataProvider(),
			$this->getCompiler()
		);
	}
751580
public function execute()
    {
        if (isset($_POST['ajax_submit']) || $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
            //if($this->app->jquery)$this->app->jquery->getJS($this->owner);

            if (headers_sent($file, $line)) {
                echo "<br/>Direct output (echo or print) detected on $file:$line. <a target='_blank' "
                    ."href='http://agiletoolkit.org/error/direct_output'>Use \$this->add('Text') instead</a>.<br/>";
            }

            $x = $this->app->template->get('document_ready');
            if (is_array($x)) {
                $x = implode('', $x);
            }
            echo $this->_render();
            $this->app->hook('post-js-execute');
            exit;
        } else {
            throw $this
                ->exception('js()->..->execute() must be used in response to form submission or AJAX operation only');
        }
    }
838976
public function renderTemplate($templatePath = null, $data = [])
    {
        $templateData = $this->readTemplate($templatePath);
        if($data === null) {
            throw new Exception("template(): expects parameter 2 to be array, null given");
        }
        foreach($data as $key => $val) {
            if(is_array($val)) {
                $findStart = strpos($templateData, '{{'.$key.':}}');
                if($findStart !== false) {
                    $findEnd = strpos($templateData, '{{:'.$key.'}}');
                    if($findEnd !== false) {
                        $len = 5 + strlen($key);
                        $substr = substr($templateData, $findStart, ($findEnd - $findStart));
                        $substr = substr($substr, $len);
                        $loopstr = []; #fixed-for: Uncaught Error: [] operator not supported for strings $loopstr[]
                        foreach($val as $k => $v) {
                            $temp = $substr;
                            if(is_array($v)) {
                                //$temp = strtr($temp, $v); {{}} not replaced
                                foreach($v as $ks => $vs) {
                                    $temp = str_replace('{{'.$ks.'}}', $vs, $temp);
                                }
                            }
                            else {
                                $temp = str_replace('{{'.$key.'}}', $v, $temp);
                            }
                            $loopstr[] = $temp;
                        }
                        $loopstr = implode("\n", $loopstr);
                        $templateData = str_replace('{{'.$key.':}}'.$substr.'{{:'.$key.'}}', $loopstr, $templateData);
                    }
                    else {
                        throw new Exception('Error in template : loop has not closed properely');
                        exit;
                    }
                }
            }
            else {
                $templateData = str_replace('{{'.$key.'}}', $val, $templateData);
            }
        }
        return $templateData;
    }
1157277
public function display($templateFile='',$charset='',$contentType='',$content='',$prefix='') {
        G('viewStartTime');
        // 视图开始标签
        Hook::listen('view_begin',$templateFile);
        // 解析并获取模板内容
        $content = $this->fetch($templateFile,$content,$prefix);
        // 输出模板内容
        $this->render($content,$charset,$contentType);
        // 视图结束标签
        Hook::listen('view_end');
    }
624667
public function execute()
    {
        $result = filter_var($this->value, FILTER_VALIDATE_URL);
        
        if ($result === false) {
            $this->msg = 'validator.rule.url';
        }
    }