} throw new NotFoundHttpException(Yii::t('video', 'The requested page does not exist.')); } /* 女優語系翻譯Cache cache時間:一天 */ public static function getTransferContent($language) { $model_name = 'ActorList'; $cache_name = $model_name . $language; $cache = \Yii::$app->cache; //$cache->delete($cache_name); if($cache->exists($cache_name)){ $model = $cache->get($cache_name); }else{ $timeout = 3600 * 24;
]; $check_cache = $this->checkCacheData($cache_params); if($check_cache['exist']){ $result = $this->getCacheData($check_cache['cache_name']); }else{ $transfer_content = ActorListController::getTransferContent(); $source_array = explode(',', $this->col_parse($data_string)); $targer_convert_array = []; foreach($source_array as $key2 => $value2){ $name = preg_replace('/\"/', '', $value2); $data = array_filter($transfer_content, function($item) use ($name){ return $item['origin_name'] == $name;
$list[$key1]['description'] = $language_content['description']; } } if(in_array('actor', $trans_item)){ #女優翻譯 $list[$key1]['actor'] = $this->transActor($value1['actor']); } if(in_array('tag', $trans_item)){ #標籤翻譯 $list[$key1]['tag'] = $this->transTag($value1['tag'], $parse_type); }
if(isset($params['video'])){ $model = $model->all(); }else{ $model = $model->asarray()->all(); } $model = $this->transVideoList($model, ['actor']); if(count($ad_list) > 0){ //$model = array_merge($ad_list, $model); foreach($ad_list as $key1 => $value1){ $current_array[0] = $value1; array_splice( $model, $value1['sort'], 0, $current_array ); // splice in at position 3
$args = $this->controller->bindActionParams($this, $params); Yii::debug('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); if ($oldController !== null) { Yii::$app->controller = $oldController; } return $result; }
$params = $this->catchAll; unset($params[0]); } try { Yii::debug("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } $response = $this->getResponse(); if ($result !== null) {
{ 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();
echo '請先設定預設語系!'; exit; } if(isset($_COOKIE['language'])){ $config['language'] = $_COOKIE['language']; } (new yii\web\Application($config))->run();
$_GET = [ 'tag' => '%E0%B8%99%E0%B8%A1%E0%B9%83%E0%B8%AB%E0%B8%8D%E0%B9%88+', 'origin_id' => 'Big+boobs', 'page' => '4', ]; $_SESSION = [ '__flash' => [], ];