Giter VIP home page Giter VIP logo

cihbs's Introduction

CIHBS - HMVC ve Twitter Bootstrap ile Olusturulmus CI Sablonu

CIHBS kisaltmasi, CodeIgniter Hmvc ve BootStrap kelimelerinin bas harfelrinden olusmaktadir. CodeIgniter 2.1 versiyonu ile hazirlaigim bu sablon, HMVC ile Twitter Bootstrap V2.0.2 arayüzünü içerir. Dizin yapisi asagidaki yapiya benzerdir: application/ config/ controllers/ auth.php modules/ dashboard/ controllers/ admin.php dashboard.php models/ dashboard.php views/ admin/ index.php form.php welcome/ controllers/ admin.php welcome.php models/ welcome_model.php views/ welcome_view.php admin/ index.php form.php views/ layout_view.php header_view.php footer_view.php meta_view.php system/ index.php

Bu yapida gördügünüz üzere, giris-çikis kontrolü application/controllers/auth.php dosyasi üzerinden saglanir. Her bir modül ise, application/modules dizini altinda kendi ismi ile MVC yapisina sahiptir.

Kullanicinin erisim yetkisi, controller dosyasinin construct modülünde kontrol edilir:

		function __construct() {

			parent::__construct();

			if(! $this->hmvc_auth->get('logged_in')) exit('Yetkili degilsiniz');
		}

Eger kullanicimizin rolü "admin" ise (veritabaninaki "role" tablosu degeri "a" ise), her controller dizini içindeki admin.php dosyasina erisilebilir. Admin kontrolü ise yine construct mödülünde kontrol edilir:

		function __construct()
		{
			parent::__construct();

			if(! $this->hmvc_auth->is_admin()) exit('Admin degilsiniz!');
			
		}

Yönetici paneline erisim için gerekli yönlendirmeler ise Application/config/routes.php dosyasindan yapilir:

		$route['(login|logout)'] = "auth/$1";

		$route['admin/([a-zA-Z_-]+)/(:any)'] = '$1/admin/$2';

		$route['admin/([a-zA-Z_-]+)'] = '$1/admin/index';

Twitter Bootstrap arayüzü de hem kullanim kolayligi, hem de estetik olmasi açisindan bu sablona giydirildi. Bu arayüz temel olarak 3 ana parçaya ayrildi: header, footer, meta view. Her controller dosyasinda bulunan render methodu ile controller'a özgü parçalar bir araya getirilip, ekrana bastirilmaktadir.

cihbs's People

Contributors

fatihbazman avatar mustafauysal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.