maloi59ru
Новичок
Дата регистрации:
20.03.2014 09:38:44
Сообщений: 8
index.php
switch ($action) {
case "about":
$content = new AbouteContent($db);
break;
case "race":
$content = new RaceContent($db);
break;
case "classes":
$content = new ClassesContent($db);
break;
content_class.php
// ВСПОМОГАТЕЛЬНАЯ ФУНКЦИЯ ВЫВОДА ПОД МЕНЮ
protected function getNavigation_Sab_Mmorpg() {
$navigation = $this->navigation->getAllMenu();
for ($i = 0; $i < count($navigation); $i++) {
$sr["title"] = $navigation[$i]["title"];
$sr["link_about"] = $this->config->address."?action=about&id=".$navigation[$i]["id"];
$sr["link_race"] = $this->config->address."?action=race&id=".$navigation[$i]["id"];
$sr["link_classes"] = $this->config->address."?action=classes&id=".$navigation[$i]["id"];
$text .= $this->getReplaceTemplate($sr, "navigation_mmorpg_sab"
}
return $text;
}
У меня вопрос как правильно сделать ЧПУ в .htaccess файле, пример:
.htaccess
RewriteEngine On
RewriteRule ^games/([a-z]+)/([0-9]+) ?action=$1&id=$2 [L]
И как правильно прописать пути в
$sr["link_about"] = $this->config->address."?action=about&id=".$navigation[$i]["id"];
$sr["link_race"] = $this->config->address."?action=race&id=".$navigation[$i]["id"];
$sr["link_classes"] = $this->config->address."?action=classes&id=".$navigation[$i]["id"];