http://mysite/en/corporate/about-us
hata
Warning: require(D:\xampp\htdocs/app/controller/corporate.php):
failed to open stream: No such file or directory in
D:\xampp\htdocs\index.php on line 36
Fatal error: require(): Failed opening required 'D:\xampp\htdocs/app/controller/corporate.php'
(include_path='D:\xampp\php\PEAR') in D:\xampp\htdocs\index.php on line 36
index.php
if ((isset($_GET['lang']) && $_GET['lang']) &&
(isset($_GET['category']) && $_GET['category']) &&
(isset($_GET['service']) && $_GET['service'])) {
require_once './app/controller/category.php';
exit();
}
$routeExplode = explode('?', $_SERVER['REQUEST_URI']);
$route = array_values(array_filter(explode('/', $routeExplode[0])));
if (!route(1)) {
$route[1] = 'index';
}
require controller(route(1));
.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
RewriteRule ^([a-z]{2})/?([a-zA-Z0-9-_/]+)?$ index.php?lang=$1 [QSA]
RewriteRule ^([a-z]{2})/([a-z0-9-]{3,})/([a-z0-9-]+)$ index.php?lang=$1&category=$2&service=$3 [QSA]
RewriteRule ^sitemap.xml$ sitemap.php [NC,L]
app.php
function route($index)
{
global $route;
return isset($route[$index]) ? $route[$index] : false;
}
function controller($controllerName)
{
$controllerName = strtolower($controllerName);
return PATH . '/app/controller/' . $controllerName . '.php';
}
function view($viewName)
{
return PATH . '/app/view/' . setting('theme') . '/' . $viewName . '.php';
}
category.php
extract($_GET);
$service_ = Blog::getService($category, $service);
$category_url = Blog::getServiceCategoriesPage($service_['page_categories']);
if (!$service_) {
header('Location:' . site_url('404'));
exit;
}
$seo = json_decode($service_['page_seo'], true);
$meta = [
'title' => $seo['title'] ? $seo['title'] : $service_['page_title'],
'description' => $seo['description'] ? $seo['description'] : cut_text($service_['page_content'])
];
$pages = $db->from('pages')
->select('pages.*')
->where('page_categories', $service_['page_categories'])
->where('page_status', '1')
->all();
$slider = $db->from('page_images')
->where('image_page_id ', $service_['page_id'])
->where('image_status', '1')
->orderby('image_order', 'ASC')
->all();
require view('category');