/home
/icerik
/domains
/enicerik.com
/public_html
/App
/Controllers
/Frontend
/ContentController.php
$this->model['content'] = Model::namespace('backend')->run('ContentModel');
$this->model['category'] = Model::namespace('backend')->run('ContentCategoryModel');
$this->model['setting'] = Model::namespace('backend')->run('SettingModel');
}
public function index(){
$contents = $this->model['content']->all();
$site_color = json_decode($this->model['setting']->get('site_color'), true);
$site_color = $site_color['colors'][$site_color['current']];
ExtendedView::render('frontend.pages.content.view',['contents' => $contents,'current_color' => $site_color]);
}
public function information($slug){
$content = $this->model['content']->whereSlug($slug);
$categories = $this->model['category']->whereAllContentId($content->id);
$site_color = json_decode($this->model['setting']->get('site_color'), true);
$site_color = $site_color['colors'][$site_color['current']];
ExtendedView::render('frontend.pages.content.information',['content' => $content,'categories' => $categories,'current_color' => $site_color]);
}
public function order($slug){
if(Request::isMethod('POST') && csrf_check(Request::post('_token'))){
$rules = [
'project_title' => ['label' => 'Proje Başlığı' , 'rules' => 'required'],
'content_count' => ['label' => 'Makale Adet' , 'rules' => 'required|max_numeric,50,min_numeric,1']
];
Validation::rules($rules,request());
/home
/icerik
/domains
/enicerik.com
/public_html
/App
/Controllers
/Frontend
/ContentController.php
$this->model['content'] = Model::namespace('backend')->run('ContentModel');
$this->model['category'] = Model::namespace('backend')->run('ContentCategoryModel');
$this->model['setting'] = Model::namespace('backend')->run('SettingModel');
}
public function index(){
$contents = $this->model['content']->all();
$site_color = json_decode($this->model['setting']->get('site_color'), true);
$site_color = $site_color['colors'][$site_color['current']];
ExtendedView::render('frontend.pages.content.view',['contents' => $contents,'current_color' => $site_color]);
}
public function information($slug){
$content = $this->model['content']->whereSlug($slug);
$categories = $this->model['category']->whereAllContentId($content->id);
$site_color = json_decode($this->model['setting']->get('site_color'), true);
$site_color = $site_color['colors'][$site_color['current']];
ExtendedView::render('frontend.pages.content.information',['content' => $content,'categories' => $categories,'current_color' => $site_color]);
}
public function order($slug){
if(Request::isMethod('POST') && csrf_check(Request::post('_token'))){
$rules = [
'project_title' => ['label' => 'Proje Başlığı' , 'rules' => 'required'],
'content_count' => ['label' => 'Makale Adet' , 'rules' => 'required|max_numeric,50,min_numeric,1']
];
Validation::rules($rules,request());
/home
/icerik
/domains
/enicerik.com
/public_html
/System
/Libs
/Router
/Router.php
array_shift($params);
// Checking middlewares
if (array_key_exists('middlewares', $val)) {
foreach ($val['middlewares'] as $midKey => $midVal) {
list($controller, $method) = explode('@', $midVal['callback']);
if (class_exists($controller)) {
call_user_func_array([new $controller, $method], []);
}
}
}
if (is_callable($val['callback'])) {
call_user_func_array($val['callback'], array_values($params));
} else if (stripos($val['callback'], '@') !== false) {
list($controller, $method) = explode('@', $val['callback']);
if (class_exists($controller)) {
call_user_func_array([new $controller, $method], array_values($params));
} else {
self::pageNotFound();
}
}
break;
}
}
}
if ($matched === 0)
self::pageNotFound();
}
/**
* Check Domain
*
* @param array $params
/home
/icerik
/domains
/enicerik.com
/public_html
/System
/Libs
/Router
/Router.php
array_shift($params);
// Checking middlewares
if (array_key_exists('middlewares', $val)) {
foreach ($val['middlewares'] as $midKey => $midVal) {
list($controller, $method) = explode('@', $midVal['callback']);
if (class_exists($controller)) {
call_user_func_array([new $controller, $method], []);
}
}
}
if (is_callable($val['callback'])) {
call_user_func_array($val['callback'], array_values($params));
} else if (stripos($val['callback'], '@') !== false) {
list($controller, $method) = explode('@', $val['callback']);
if (class_exists($controller)) {
call_user_func_array([new $controller, $method], array_values($params));
} else {
self::pageNotFound();
}
}
break;
}
}
}
if ($matched === 0)
self::pageNotFound();
}
/**
* Check Domain
*
* @param array $params
/home
/icerik
/domains
/enicerik.com
/public_html
/System
/Kernel
/Kernel.php
use System\Facades\Facade;
use Whoops\Run as WhoopsRun;
use Whoops\Handler\PrettyPageHandler as WhoopsPrettyPageHandler;
class Kernel
{
public function __construct()
{
// Initialize Whoops Error Handler
$this->initWhoops();
// Initialize Config
$this->initApplications();
// Getting Routes
Import::config('routes');
// Starting Router
Router::run();
}
/**
* Whoops Initializer
*
* @return object
*/
private function initWhoops()
{
$whoops = new WhoopsRun;
$whoops->pushHandler(new WhoopsPrettyPageHandler);
$whoops->register();
return $this;
}
/**
* Application Initializer
*
* @return void
/home
/icerik
/domains
/enicerik.com
/public_html
/index.php
* Titan-2 Mini Framework
* Simple and Modern Web Application Framework
*
* Author : Turan Karatuğ
* Web : http://www.titanphp.com
* Docs : http://kilavuz.titanphp.com
* Version : 2.2.0
* Github : http://github.com/tkaratug/titan2
* License : MIT
*
*************************************************/
// Require Composer Autoload
require_once __DIR__ . '/vendor/autoload.php';
// Require Starter
require_once __DIR__ . '/System/Kernel/Starter.php';
// Run Kernel
new System\Kernel\Kernel();