【发布时间】:2017-03-22 04:34:35
【问题描述】:
我在尝试为不同的 href 运行 if statement 时收到此错误
解析错误:语法错误,意外的 'if' (T_IF),期望 ')' 在 D:\xampp\htdocs\ramesh\wmw\catalog\controller\product\sub_category.php 第 29 行
sub_category.php
foreach ($category_info as $result) {
$data['categories'][] = array(
'name' => $result['name'],
'parent_id' => $result['parent_id'],
'thumb' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_category_width'), this->config->get('config_image_category_height')),
'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('config_product_description_length')) . '..',
/*'href' => $this->url->link('product/filter', '&category_id=' . $result['category_id'])
'href' => $this->url->link('product/sub_category')*/
if($result['category_id']==24)
{
'href' => $this->url->link('product/transmission', 'sub_category_id='.$result['parent_id'].'&category_id=' . $result['category_id'])
}
elseif
{
/*some code for href*/
}
);
}
【问题讨论】:
-
感谢重播@PhilipTzou 对不起,我不明白,请在我的代码中告诉我。对我来说很容易
标签: if-statement opencart href