Ну вот класс C_Base
<?php
abstract class C_Base extends C_Controller {
protected $title;
protected $content;
function __construct()
{
}
protected function startup() {
$hostname = 'localhost';
$username = 'root';
$password = '';
$dbName = 'lesson1';
setlocale(LC_ALL, 'ru_RU.CP1251');
mysql_connect($hostname, $username, $password) or die('No connect with data base');
mysql_query('SET NAMES cp1251');
mysql_select_db($dbName) or die('No data base');
session_start();
}
protected function OnInput()
{
$this -> startup('localhost', 'username', '');
$this -> title = 'Блог о PHP';
$this -> content = '';
}
protected function OnOutput()
{
$vars = array('title' => $this->title, 'content' => $this->content);
$this->content = $this->Template('v/v_index.php', $vars);
parent:: OnOutput();
}
}