* @return void */ public function viewItemEvent(string $name) { $c = Yii::$app->params; $analytics4List = $this->analytics4List; $analyticsList = $this->analyticsList; !$name && $name = $c['lang_pack']['web']['global']['all_products']; $param = [ 'currency' => $_SESSION['Currency']['Currency'], 'value' => 0, 'items' => [ [ 'item_name' => addslashes($name) ] ]
{ $c = Yii::$app->params; $analytics4List = $this->analytics4List; $analyticsList = $this->analyticsList; !$name && $name = $c['lang_pack']['web']['global']['all_products']; $param = [ 'currency' => $_SESSION['Currency']['Currency'], 'value' => 0, 'items' => [ [
]; $this->pagePixel .= HelpsFacebook::ViewContent($pixelParams); } } // Google View Item Event Code $google = new HelpsGoogle(); $this->pagePixel .= $google->viewItemEvent($Name); $data = compact('ProId','productsRow','action','spareAry','productsDescriptionRow'); } else if ($action == 'collections') { // 目录页 $data = compact('action'); $canonicalUrl = '/collections/';
public $pagePixel; public function init() { parent::init(); // 装载可视化页面数据 $this->pagesDataInit = $this->pagesDataInit(); // 构建可视化$c数据 $action = $this->pagesDataInit['action']; $action = $action == 'products' ? 'list' : $action; $id = $this->pagesDataInit['ProId'] ?? 0; $row = [];
*/ public function __construct($config = []) { if (!empty($config)) { Yii::configure($this, $config); } $this->init(); } /** * Initializes the object. * This method is invoked at the end of the constructor after the object is initialized with the * given configuration.
* @param array $config name-value pairs that will be used to initialize the object properties. */ public function __construct($id, $module, $config = []) { $this->id = $id; $this->module = $module; parent::__construct($config); } /** * {@inheritdoc} * @since 2.0.36 */
$dependencies = $this->resolveDependencies($dependencies, $reflection); if (!$reflection->isInstantiable()) { throw new NotInstantiableException($reflection->name); } if (empty($config)) { return $reflection->newInstanceArgs($dependencies); } $config = $this->resolveDependencies($config); if (!empty($dependencies) && $reflection->implementsInterface('yii\base\Configurable')) { // set $config as the last parameter (existing one will be overwritten)
$class = $class->id; } if (isset($this->_singletons[$class])) { // singleton return $this->_singletons[$class]; } elseif (!isset($this->_definitions[$class])) { return $this->build($class, $params, $config); } $definition = $this->_definitions[$class]; if (is_callable($definition, true)) { $params = $this->resolveDependencies($this->mergeParams($class, $params));
* @throws InvalidConfigException if the configuration is invalid. * @see \yii\di\Container */ public static function createObject($type, array $params = []) { if (is_string($type)) { return static::$container->get($type, $params); } if (is_callable($type, true)) { return static::$container->invoke($type, $params); }
$className = ltrim($this->controllerNamespace . '\\' . str_replace('/', '\\', $prefix) . $className, '\\'); if (strpos($className, '-') !== false || !class_exists($className)) { return null; } if (is_subclass_of($className, 'yii\base\Controller')) { $controller = Yii::createObject($className, [$id, $this]); return get_class($controller) === $className ? $controller : null; } elseif (YII_DEBUG) { throw new InvalidConfigException('Controller class must extend from \\yii\\base\\Controller.'); } return null;
if (($pos = strrpos($route, '/')) !== false) { $id .= '/' . substr($route, 0, $pos); $route = substr($route, $pos + 1); } $controller = $this->createControllerByID($id); if ($controller === null && $route !== '') { $controller = $this->createControllerByID($id . '/' . $route); $route = ''; } return $controller === null ? false : [$controller, $route];
* @param array $params the parameters to be passed to the action * @return mixed the result of the action. * @throws InvalidRouteException if the requested route cannot be resolved into an action successfully. */ public function runAction($route, $params = []) { $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);
$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();
require __DIR__ . '/../common/config/main.php', require __DIR__ . '/../common/config/main-local.php', require __DIR__ . '/config/main.php', require __DIR__ . '/config/main-local.php' ); (new yii\web\Application($config))->run();
$_GET = [ 'r' => 'products/goods', 'ProId' => '0125', ]; $_SESSION = [ '__flash' => [], 'ManageCurrency' => [ 'CId' => '1', 'Name' => '{"en":"US Dollar","zh-cn":"美元"}', 'Currency' => 'USD', 'Symbol' => '$', 'ExchangeRate' => '1.0000', 'Rate' => '1.0000', 'IsUsed' => '1', 'IsDefault' => '1', 'ManageDefault' => '1', 'FlagPath' => '//ueeshop.ly200-cdn.com/static/images/currency/USD.jpg', 'IsFixed' => '1', 'MyOrder' => '1', ], 'Currency' => [ 'CId' => '1', 'Name' => '{"en":"US Dollar","zh-cn":"美元"}', 'Currency' => 'USD', 'Symbol' => '$', 'ExchangeRate' => '1.0000', 'Rate' => '1.0000', 'IsUsed' => '1', 'IsDefault' => '1', 'ManageDefault' => '1', 'FlagPath' => '//ueeshop.ly200-cdn.com/static/images/currency/USD.jpg', 'IsFixed' => '1', 'MyOrder' => '1', ], 'operActive' => [ 'editTime' => '1680573827', 'enterWebTime' => 1711723366, 'data' => [], ], 'Ueeshop' => [ 'ViewHistory' => [ '125', ], ], 'Manage' => [ 'WebDomain' => 'https://ahamaterials.com', ], ];