Czy dobrze zrozumiałem istotę wzorca MVC (wkońcu)?
Jeśli tak to ułatwi mi to pracę
<?php
//Wyświetl wszystkie błędy(0=niewyświetlaj nic)
/* Załaduj wymagane pliki */
require_once 'includes/config.php'; //Konfiguracja
require_once 'DL_Libary/DL_Framework.php'; //Funkcje
require_once 'DL_Libary/DL_Controller.php'; //Kontroler
require_once 'DL_Libary/DL_Model.php'; //Model
require_once 'DL_Libary/DL_View.php'; //Widok
$oController = new DL_Controller;
$test = '<br /><br /><br /><br /><br /><br />';
error('Testowy Błąd');
$oController -> view -> assign('test', $test);
$oController -> view -> display('index');
?>
Teraz drugie pytanie
Lepiej jest przechowywać ustawienia w stałych czy w takiej postaci:
<?php
Class Config
{
/* Configuration framework*/
'viewsDir' => 'views',
'libaryDir' => 'DL_Libary'
);
/* Configuration system */
'webUrl' => 'http://localhost',
);
/* Configuration database */
'host' => 'localhost',
'user' => 'root',
'pass' => '',
'database' => 'sss',
'type' => 'mysql',
'status' => false
);
}
?>
Ustawienia są na localhost więc sie nie boję
Ten post edytował daniel1302 11.04.2008, 18:45:24