[ Поиск ] - [ Пользователи ] - [ Календарь ]
Полная Версия: MVC не подключаются стили
Страницы: 1, 2, 3
arbuzmaster
Цитата (brevis @ 23.12.2016 - 13:47)
arbuzmaster, покажи уже код наверное. А то гадание что-то не очень эффективно.
Разве что перед этим попробуй в httpd.conf добавить
<pre class="sh_sourceCode" rel="code">EnableSendFile off</pre>
ну а вдруг :)

Их нет у меня!
root@smart-home64:/# find -name "httpd.conf"
root@smart-home64:/#

Какой код показать?

login.php

<!-- Bootstrap -->
<link href="/template/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<!-- Font Awesome -->
<link href="/template/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!-- NProgress -->
<link href="/template/css/nprogress.css" rel="stylesheet" type="text/css">
<!-- Animate.css -->
<link href="/template/css/animate.min.css" rel="stylesheet" type="text/css">

<!-- Custom Theme Style -->
<link href="/template/css/custom.min.css" rel="stylesheet" type="text/css">


class UserController {
public function actionLogin()
{
//echo 'actionLogin';
require_once (ROOT.'/views/user/login.php');
return TRUE;
}
....
}

routes.php

return array(


'user/register'=>'user/register',
'user/login'=>'user/login',
'user/logout'=>'user/logout',

);



Router.php

class Router
{
private $routes;
public function __construct()
{
$routesPath=ROOT.'/config/routes.php';
$this->routes= include ($routesPath);
}
public function getURI()
{
//Получаем строку запроса
if (!empty($_SERVER['REQUEST_URI']))
{
return trim($_SERVER['REQUEST_URI'],'/');
}

}

public function run()
{
//Получаем строку запроса
$uri=$this->getURI();
foreach ($this->routes as $uriPattern => $path)
{
if (preg_match("~$uriPattern~", $uri))
{
$intrnalRoute= preg_replace("~$uriPattern~", $path, $uri);

//$segments= explode("/", $path);
$segments= explode("/", $intrnalRoute);
$controllerName= array_shift($segments).'Controller';
$controllerName= ucfirst($controllerName);

$actionName='action'.ucfirst(array_shift($segments));
$parameters=$segments;
//print_r($parameters);
$controllerFile=ROOT.'/controllers/'.$controllerName.'.php';
if (file_exists($controllerFile))
{
include_once ($controllerFile);
}

$controllerObject=new $controllerName;
$result= call_user_func_array(array($controllerObject,$actionName), $parameters);
if ($result !=NULL)
{
break;
}
}
}
}
}


index.php

<?php
/*
* Front controller
*/

// 1. Settings

ini_set('display_errors', 1);
error_reporting(E_ALL);

// 2. Require files and components

define('ROOT', dirname(__FILE__));
require_once (ROOT.'/components/Router.php');
require_once (ROOT.'/components/Db.php');
// 3. Data Base connection

// 4. Router Call

$router=new Router();
$router->run();


_____________
Мой первый сайтик

Посмотри на свой XBMC под другим углом
Быстрый ответ:

 Графические смайлики |  Показывать подпись
Здесь расположена полная версия этой страницы.
Invision Power Board © 2001-2025 Invision Power Services, Inc.