in /var/www/html/huaian_www/vendor/yiisoft/yii2-httpclient/StreamTransport.php at line 61
try { $context = stream_context_create($contextOptions); $stream = fopen($url, 'rb', false, $context); $responseContent = stream_get_contents($stream); // see http://php.net/manual/en/reserved.variables.httpresponseheader.php $responseHeaders = $http_response_header; fclose($stream); } catch (\Exception $e) { Yii::endProfile($token, __METHOD__); throw new Exception($e->getMessage(), $e->getCode(), $e); } Yii::endProfile($token, __METHOD__); $response = $request->client->createResponse($responseContent, $responseHeaders); $request->afterSend($response); return $response;
* @param Request $request request to be sent. * @return Response response instance. * @throws Exception on failure. */ public function send($request) { return $this->getTransport()->send($request); } /** * Performs multiple HTTP requests in parallel. * This method accepts an array of the [[Request]] objects and returns an array of the [[Response]] objects. * Keys of the response array correspond the ones from request array.
/** * Sends this request. * @return Response response instance. */ public function send() { return $this->client->send($this); } /** * This method is invoked right before this request is sent. * The method will invoke [[Client::beforeSend()]] and trigger the [[EVENT_BEFORE_SEND]] event. * @since 2.0.1
} // echo $url;exit; $request = $client->createRequest(); $request->setMethod('post'); $request->setUrl($url); $response = $request->send(); \Yii::info("url:{$request->fullUrl} response status:{$response->statusCode}",'api'); if ($response->isOk) { $data = $response->data; // $logInfo = Json::encode($data);
/* * 淮安站首页推荐服务 获取列表(读取solrQuery 接口) */ public static function getIndexServiceLists($page = 1, $limit = 10, $serviceTarget = "") { $data = Service::getHuaianIndexService($page, $limit, $serviceTarget); if (isset($data['items']) and !empty($data['items'])) { foreach ($data['items'] as $key => $value) { $data['items'][$key]['url'] = self::getDetailsUrl_($value['serviceId']); $data['items'][$key]['cateName'] = self::getCateNameById($value['serviceId']); $data['items'][$key]['img'] = self::getServiceImg_($value['cover']);
<?php use common\lib\Common; use frontend\models\EnterpriseService; //推荐服务 //推荐服务 $recommendService = EnterpriseService::getIndexServiceLists(1,4); ?> <div class="SL-right"> <!--推荐服务↓-->
*/ public function renderPhpFile($_file_, $_params_ = []) { ob_start(); ob_implicit_flush(false); extract($_params_, EXTR_OVERWRITE); require($_file_); return ob_get_clean(); } /** * Renders dynamic content returned by the given PHP statements.
$this->renderers[$ext] = Yii::createObject($this->renderers[$ext]); } /* @var $renderer ViewRenderer */ $renderer = $this->renderers[$ext]; $output = $renderer->render($this, $viewFile, $params); } else { $output = $this->renderPhpFile($viewFile, $params); } $this->afterRender($viewFile, $params, $output); } array_pop($this->_viewFiles); $this->context = $oldContext;
* @throws InvalidParamException if the view cannot be resolved or the view file does not exist. * @see renderFile() */ public function render($view, $params = [], $context = null) { $viewFile = $this->findViewFile($view, $context); return $this->renderFile($viewFile, $params, $context); } /** * Finds the view file based on the given view name. * @param string $view the view name or the path alias of the view file. Please refer to [[render()]] * on how to specify this parameter.
</div> <!--专家↑--> </div> <!--left↑--> <!--right↓--> <div class="right"> <?php echo $this->render('/public/search-list-right') ?> </div> <!--right↑--> </div> </div> <!--内容↑-->
*/ public function renderPhpFile($_file_, $_params_ = []) { ob_start(); ob_implicit_flush(false); extract($_params_, EXTR_OVERWRITE); require($_file_); return ob_get_clean(); } /** * Renders dynamic content returned by the given PHP statements.
$this->renderers[$ext] = Yii::createObject($this->renderers[$ext]); } /* @var $renderer ViewRenderer */ $renderer = $this->renderers[$ext]; $output = $renderer->render($this, $viewFile, $params); } else { $output = $this->renderPhpFile($viewFile, $params); } $this->afterRender($viewFile, $params, $output); } array_pop($this->_viewFiles); $this->context = $oldContext;
* @throws InvalidParamException if the view cannot be resolved or the view file does not exist. * @see renderFile() */ public function render($view, $params = [], $context = null) { $viewFile = $this->findViewFile($view, $context); return $this->renderFile($viewFile, $params, $context); } /** * Finds the view file based on the given view name. * @param string $view the view name or the path alias of the view file. Please refer to [[render()]] * on how to specify this parameter.
* These parameters will not be available in the layout. * @return string the rendering result. * @throws InvalidParamException if the view file or the layout file does not exist. */ public function render($view, $params = []) { $content = $this->getView()->render($view, $params, $this); return $this->renderContent($content); } /** * Renders a static string by applying a layout. * @param string $content the static string being rendered
//数据构造 $dataProvider = $searchModel->search(\Yii::$app->getRequest()->getQueryParams()); // var_dump($searchModel->brandList);exit; return $this->render("index",[ 'dataProvider'=>$dataProvider, 'searchModel'=>$searchModel, ]); } } ?>
$args = $this->controller->bindActionParams($this, $params); Yii::trace('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__); if (Yii::$app->requestedParams === null) { Yii::$app->requestedParams = $args; } return call_user_func_array([$this->controller, $this->actionMethod], $args); } }
} $result = null; if ($runAction && $this->beforeAction($action)) { // run the action $result = $action->runWithParams($params); $result = $this->afterAction($action, $result); // call afterAction on modules foreach ($modules as $module) { /* @var $module Module */
$parts = $this->createController($route); if (is_array($parts)) { /* @var $controller Controller */ list($controller, $actionID) = $parts; $oldController = Yii::$app->controller; Yii::$app->controller = $controller; $result = $controller->runAction($actionID, $params); Yii::$app->controller = $oldController; return $result; } else { $id = $this->getUniqueId(); throw new InvalidRouteException('Unable to resolve the request "' . ($id === '' ? $route : $id . '/' . $route) . '".');
// // } // $userModel = new Tluser(); // $userModel->checkLogin(); Yii::trace("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } else { $response = $this->getResponse(); if ($result !== null) { $response->data = $result;
try { $this->state = self::STATE_BEFORE_REQUEST; $this->trigger(self::EVENT_BEFORE_REQUEST); $this->state = self::STATE_HANDLING_REQUEST; $response = $this->handleRequest($this->getRequest()); $this->state = self::STATE_AFTER_REQUEST; $this->trigger(self::EVENT_AFTER_REQUEST); $this->state = self::STATE_SENDING_RESPONSE; $response->send();
$application->language='ru-RU'; } }else{ $application->language='zh-CN'; } $application->language='zh-CN'; $application->run();
$_GET = [ 'ProductSearch' => [ 'classIds' => '99007050', 'className' => '光隔离放大器', ], ];