foreach (static::$aliases[$root] as $name => $path) {
if (strpos($alias . '/', $name . '/') === 0) {
return $path . substr($alias, strlen($name));
}
}
}
if ($throwException) {
throw new InvalidArgumentException("Invalid path alias: $alias");
}
return false;
}
/**
* Returns the root alias part of a given alias.
* A root alias is an alias that has been registered via [[setAlias()]] previously.
* If a given alias matches multiple root aliases, the longest one will be returned.
}
} catch (\Exception $e) {
// Column might not exist yet, continue to other methods
}
// Second, try local image file from web folder
$localPath = Yii::getAlias('@frontend/web/img/brands/' . $brand->slug . '.webp');
if (is_file($localPath)) {
return Html::img('/img/brands/' . $brand->slug . '.webp', ['class' => 'brand', 'alt' => Html::encode($brand->name)]);
}
// Third, try other common formats in local folder
foreach (['png', 'jpg', 'jpeg', 'gif'] as $ext) {
<strong>R├®f. MP-Technic: </strong><?= $model->ref ?><br>
<strong>R├®f. Constructeur: </strong><?= $model->brandRef ?><br>
<?php if ($model->ean) : ?>
<strong>EAN: </strong><?= $model->ean ?><br>
<?php endif ?>
<br>
<?= Html::brandIcon($model->brand) ?>
<table style="margin-top:1em">
<?php $k=0; foreach($specs as $spec) : if ($k++ > 2) break; ?>
<tr>
<th style="text-align:left; padding-right: 10px;"><?= Html::encode($spec->name) ?>:</th>
<td><?= $model->specs[$spec->uid] ?> <?php if ($spec->unit) echo $spec->unit; ?></td>
</tr>
{
$_obInitialLevel_ = ob_get_level();
ob_start();
ob_implicit_flush(false);
extract($_params_, EXTR_OVERWRITE);
try {
require $_file_;
return ob_get_clean();
} catch (\Exception $e) {
while (ob_get_level() > $_obInitialLevel_) {
if (!@ob_end_clean()) {
ob_clean();
}
$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 InvalidCallException if the view cannot be resolved.
* @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](guide:concept-aliases) 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 InvalidArgumentException 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
$model->price = $special;
}
}
Yii::$app->seo::addProduct($model);
return $this->render('view', [
'model' => $model,
]);
}
private function viewGrouped($model)
{
$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();
$config = yii\helpers\ArrayHelper::merge(
require __DIR__ . '/../common/config/main.php',
require __DIR__ . '/../frontend/config/main.php'
);
(new yii\web\Application($config))->run();
// Some frameworks check SERVER_PORT etc. $_SERVER['SERVER_PORT'] = '8000'; // Prevent headers already sent ob_start(); require __DIR__ . '\\..\\web\\index.php'; $output = ob_get_clean(); echo $output;
$_GET = [
'id' => unserialize('O:21:"common\\models\\Product":10:{s:27:"' . "\0" . 'yii\\base\\Component' . "\0" . '_events";a:0:{}s:35:"' . "\0" . 'yii\\base\\Component' . "\0" . '_eventWildcards";a:0:{}s:30:"' . "\0" . 'yii\\base\\Component' . "\0" . '_behaviors";a:0:{}s:23:"' . "\0" . 'yii\\base\\Model' . "\0" . '_errors";N;s:27:"' . "\0" . 'yii\\base\\Model' . "\0" . '_validators";N;s:25:"' . "\0" . 'yii\\base\\Model' . "\0" . '_scenario";s:7:"default";s:36:"' . "\0" . 'yii\\db\\BaseActiveRecord' . "\0" . '_attributes";a:25:{s:2:"id";i:15921;s:3:"ref";s:12:"326.x0652631";s:4:"name";s:28:"FORETSK3-253FO[8,20X47,0-89]";s:4:"slug";s:27:"foretsk3-253fo-8-20x47-0-89";s:8:"brand_id";i:326;s:3:"sku";s:8:"x0652631";s:3:"ean";N;s:11:"category_id";i:750;s:6:"family";s:26:"Foret carbure revêtu 03xD";s:16:"full_description";N;s:17:"short_description";N;s:9:"is_active";i:1;s:8:"stock_tn";i:0;s:8:"stock_fr";i:0;s:5:"price";s:5:"28.08";s:5:"specs";a:5:{s:3:"atd";s:3:"NON";s:8:"diametre";s:4:"8.20";s:13:"longeur_coupe";s:2:"47";s:14:"diametre_queue";s:2:"10";s:14:"longeur_totale";s:2:"89";}s:8:"dolibarr";a:2:{s:7:"old_ref";s:8:"x0652631";s:12:"selimdata_id";s:5:"16459";}s:3:"seo";N;s:7:"website";N;s:8:"image_id";i:2891;s:6:"images";N;s:7:"nb_sold";i:0;s:15:"extracted_specs";N;s:8:"price_fr";s:6:"28.080";s:8:"price_tn";s:6:"28.080";}s:39:"' . "\0" . 'yii\\db\\BaseActiveRecord' . "\0" . '_oldAttributes";a:25:{s:2:"id";i:15921;s:3:"ref";s:12:"326.x0652631";s:4:"name";s:28:"FORETSK3-253FO[8,20X47,0-89]";s:4:"slug";s:27:"foretsk3-253fo-8-20x47-0-89";s:8:"brand_id";i:326;s:3:"sku";s:8:"x0652631";s:3:"ean";N;s:11:"category_id";i:750;s:6:"family";s:26:"Foret carbure revêtu 03xD";s:16:"full_description";N;s:17:"short_description";N;s:9:"is_active";i:1;s:8:"stock_tn";i:0;s:8:"stock_fr";i:0;s:5:"price";s:5:"28.08";s:5:"specs";a:5:{s:3:"atd";s:3:"NON";s:8:"diametre";s:4:"8.20";s:13:"longeur_coupe";s:2:"47";s:14:"diametre_queue";s:2:"10";s:14:"longeur_totale";s:2:"89";}s:8:"dolibarr";a:2:{s:7:"old_ref";s:8:"x0652631";s:12:"selimdata_id";s:5:"16459";}s:3:"seo";N;s:7:"website";N;s:8:"image_id";i:2891;s:6:"images";N;s:7:"nb_sold";i:0;s:15:"extracted_specs";N;s:8:"price_fr";s:6:"28.080";s:8:"price_tn";s:6:"28.080";}s:33:"' . "\0" . 'yii\\db\\BaseActiveRecord' . "\0" . '_related";a:3:{s:5:"brand";O:19:"common\\models\\Brand":10:{s:27:"' . "\0" . 'yii\\base\\Component' . "\0" . '_events";a:0:{}s:35:"' . "\0" . 'yii\\base\\Component' . "\0" . '_eventWildcards";a:0:{}s:30:"' . "\0" . 'yii\\base\\Component' . "\0" . '_behaviors";a:0:{}s:23:"' . "\0" . 'yii\\base\\Model' . "\0" . '_errors";N;s:27:"' . "\0" . 'yii\\base\\Model' . "\0" . '_validators";N;s:25:"' . "\0" . 'yii\\base\\Model' . "\0" . '_scenario";s:7:"default";s:36:"' . "\0" . 'yii\\db\\BaseActiveRecord' . "\0" . '_attributes";a:6:{s:2:"id";i:326;s:4:"name";s:5:"SKULT";s:4:"slug";s:5:"skult";s:7:"website";N;s:9:"is_active";i:1;s:3:"seo";N;}s:39:"' . "\0" . 'yii\\db\\BaseActiveRecord' . "\0" . '_oldAttributes";a:6:{s:2:"id";i:326;s:4:"name";s:5:"SKULT";s:4:"slug";s:5:"skult";s:7:"website";N;s:9:"is_active";i:1;s:3:"seo";N;}s:33:"' . "\0" . 'yii\\db\\BaseActiveRecord' . "\0" . '_related";a:1:{s:5:"image";N;}s:47:"' . "\0" . 'yii\\db\\BaseActiveRecord' . "\0" . '_relationsDependencies";a:1:{s:8:"image_id";a:1:{s:5:"image";s:5:"image";}}}s:5:"image";O:19:"common\\models\\Image":10:{s:27:"' . "\0" . 'yii\\base\\Component' . "\0" . '_events";a:0:{}s:35:"' . "\0" . 'yii\\base\\Component' . "\0" . '_eventWildcards";a:0:{}s:30:"' . "\0" . 'yii\\base\\Component' . "\0" . '_behaviors";a:0:{}s:23:"' . "\0" . 'yii\\base\\Model' . "\0" . '_errors";N;s:27:"' . "\0" . 'yii\\base\\Model' . "\0" . '_validators";N;s:25:"' . "\0" . 'yii\\base\\Model' . "\0" . '_scenario";s:7:"default";s:36:"' . "\0" . 'yii\\db\\BaseActiveRecord' . "\0" . '_attributes";a:10:{s:2:"id";i:2891;s:4:"size";i:43607;s:5:"width";i:747;s:6:"height";i:747;s:3:"md5";s:32:"4cd4c1e6be4cf59977b41cae8deb8d55";s:8:"mimetype";s:10:"image/jpeg";s:4:"path";s:20:"91/28/2891/16589.jpg";s:12:"origine_path";s:22:"326.X0652232/16589.jpg";s:5:"extra";N;s:7:"cropped";N;}s:39:"' . "\0" . 'yii\\db\\BaseActiveRecord' . "\0" . '_oldAttributes";a:10:{s:2:"id";i:2891;s:4:"size";i:43607;s:5:"width";i:747;s:6:"height";i:747;s:3:"md5";s:32:"4cd4c1e6be4cf59977b41cae8deb8d55";s:8:"mimetype";s:10:"image/jpeg";s:4:"path";s:20:"91/28/2891/16589.jpg";s:12:"origine_path";s:22:"326.X0652232/16589.jpg";s:5:"extra";N;s:7:"cropped";N;}s:33:"' . "\0" . 'yii\\db\\BaseActiveRecord' . "\0" . '_related";a:0:{}s:47:"' . "\0" . 'yii\\db\\BaseActiveRecord' . "\0" . '_relationsDependencies";a:0:{}}s:8:"category";O:22:"common\\models\\Category":10:{s:27:"' . "\0" . 'yii\\base\\Component' . "\0" . '_events";a:0:{}s:35:"' . "\0" . 'yii\\base\\Component' . "\0" . '_eventWildcards";a:0:{}s:30:"' . "\0" . 'yii\\base\\Component' . "\0" . '_behaviors";a:0:{}s:23:"' . "\0" . 'yii\\base\\Model' . "\0" . '_errors";N;s:27:"' . "\0" . 'yii\\base\\Model' . "\0" . '_validators";N;s:25:"' . "\0" . 'yii\\base\\Model' . "\0" . '_scenario";s:7:"default";s:36:"' . "\0" . 'yii\\db\\BaseActiveRecord' . "\0" . '_attributes";a:7:{s:2:"id";i:750;s:9:"parent_id";i:417;s:4:"name";s:6:"Forets";s:4:"slug";s:6:"forets";s:6:"facets";a:7:{i:0;s:8:"diametre";i:1;s:14:"diametre_queue";i:2;s:14:"longeur_totale";i:3;s:13:"longeur_coupe";i:4;s:7:"matiere";i:5;s:16:"matiere_a_usiner";i:6;s:10:"revetement";}s:9:"is_active";i:1;s:3:"seo";a:2:{s:14:"description_fr";N;s:14:"description_tn";N;}}s:39:"' . "\0" . 'yii\\db\\BaseActiveRecord' . "\0" . '_oldAttributes";a:7:{s:2:"id";i:750;s:9:"parent_id";i:417;s:4:"name";s:6:"Forets";s:4:"slug";s:6:"forets";s:6:"facets";a:7:{i:0;s:8:"diametre";i:1;s:14:"diametre_queue";i:2;s:14:"longeur_totale";i:3;s:13:"longeur_coupe";i:4;s:7:"matiere";i:5;s:16:"matiere_a_usiner";i:6;s:10:"revetement";}s:9:"is_active";i:1;s:3:"seo";a:2:{s:14:"description_fr";N;s:14:"description_tn";N;}}s:33:"' . "\0" . 'yii\\db\\BaseActiveRecord' . "\0" . '_related";a:0:{}s:47:"' . "\0" . 'yii\\db\\BaseActiveRecord' . "\0" . '_relationsDependencies";a:0:{}}}s:47:"' . "\0" . 'yii\\db\\BaseActiveRecord' . "\0" . '_relationsDependencies";a:1:{s:11:"category_id";a:1:{s:8:"category";s:8:"category";}}}'),
];
$_SESSION = [
'__flash' => [],
'cart' => unserialize('O:24:"frontend\\components\\Cart":1:{s:32:"' . "\0" . 'frontend\\components\\Cart' . "\0" . '_items";a:0:{}}'),
];