wwt
-
Posts
2,571 -
Joined
-
Last visited
-
Days Won
119
wwt's Achievements
Single Status Update
-
routecat_form
<input type="text" name="keyword" value="<?php echo $keyword; ?>" />
контроллер
if (isset($this->request->post['keyword'])) {
$this->data['keyword'] = $this->request->post['keyword'];
} elseif (isset($routecat_info)) {
$this->data['keyword'] = $routecat_info['keyword'];
} else {
$this->data['keyword'] = '';
}
Модель
.trim($this->db->escape($data['keyword']))."', '"
И
if ($data['keyword']) {
$this->db->query("INSERT INTO " . DB_PREFIX . "url_alias SET query = 'routecat_id=" . (int)$ routecat _id . "', keyword = '" . $this->db->escape($data['keyword']) . "'");
}
$this->cache->delete('routecat');
}
Parse error: syntax error, unexpected 'if' (T_IF), expecting function (T_FUNCTION) in /sites/xn--80agbgp3aafdnsm0c.xn--p1ai/www/admin/model/catalog/routecat.php on line 48
Ошибка в строчке if ($data['keyword']) {
$this->db->query("INSERT INTO " . DB_PREFIX . "url_alias SET query = 'routecat_id=" . (int)$ routecat _id . "', keyword = '" . $this->db->escape($data['keyword']) . "'");
}
$this->cache->delete('routecat');
}
Почему здесь аналогичный категории код не работает?