diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..67bece9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = false +charset = utf-8 +indent_style = tab + +[*.json] +indent_style = space +indent_size = 4 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ae181fb --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +# Composer +/composer.lock +/vendor/ + +# IDE +/.idea/ + +# OS Files +.DS_Store diff --git a/README.md b/README.md index 41030ab..b293bdf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # CodeIgniter-Template -CodeIgniter-Template is a Template library that helps your build complex views with CodeIgniter. +CodeIgniter-Template is a Template library that helps your build complex views with [CodeIgniter](https://codeigniter.com). It has logic to work with themes & modules and helps add your title, meta-data, breadcrumbs and partial views. @@ -9,6 +9,34 @@ It has logic to work with themes & modules and helps add your title, meta-data, 1. PHP 5.2+ 2. CodeIgniter 2.0.3 +## Installation + +* Use [composer](https://getcomposer.org) to install this package + +`composer require philsturgeon/codeigniter-template` + +* Add this **package** to auto-load packages array (application/config/autoload.php) + +`$autoload['packages'] = array(FCPATH . 'vendor/philsturgeon/codeigniter-template/src');` + +or include it with Loader library +`$this->load->add_package_path(FCPATH . 'vendor/philsturgeon/codeigniter-template/src');` + +* Add default **configuration** file to auto-load config array (application/config/autoload.php) + +`$autoload['config'] = array('template');` + +or include it with Loader library +`$this->load->config('template');` + +* Add the **library** to auto-load library array (application/config/autoload.php) + +`$autoload['library'] = array('template');` + +or include it with Loader library +`$this->load->library('template');` + + ## Documentation Open `user_guide/index.html` in your browser for docs. diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..3b4cf3a --- /dev/null +++ b/composer.json @@ -0,0 +1,9 @@ +{ + "name": "philsturgeon/codeigniter-template", + "description": "Template library for CodeIgniter which supports modules, themes, partial views, etc.", + "type": "library", + "minimum-stability": "stable", + "require": { + "php" : ">=5.2" + } +} diff --git a/index.html b/index.html new file mode 100755 index 0000000..b702fbc --- /dev/null +++ b/index.html @@ -0,0 +1,11 @@ + + +
+Directory access is forbidden.
+ + + diff --git a/config/autoload.php b/src/config/autoload.php similarity index 100% rename from config/autoload.php rename to src/config/autoload.php diff --git a/src/config/index.html b/src/config/index.html new file mode 100755 index 0000000..b702fbc --- /dev/null +++ b/src/config/index.html @@ -0,0 +1,11 @@ + + + +Directory access is forbidden.
+ + + diff --git a/config/template.php b/src/config/template.php similarity index 100% rename from config/template.php rename to src/config/template.php diff --git a/src/controllers/Template_controller.php b/src/controllers/Template_controller.php new file mode 100644 index 0000000..183089e --- /dev/null +++ b/src/controllers/Template_controller.php @@ -0,0 +1,34 @@ +load->add_package_path(FCPATH . 'vendor/philsturgeon/codeigniter-template/src'); + + $this->load->config('template'); + + $this->load->library('template'); + } + + /** + * Index Page for this controller. + * + * Maps to the following URL + * http://example.com/index.php/template + * - or - + * http://example.com/index.php/template/index + */ + public function index() + { + $this->load->view('welcome_message'); + } + +} diff --git a/src/controllers/index.html b/src/controllers/index.html new file mode 100755 index 0000000..b702fbc --- /dev/null +++ b/src/controllers/index.html @@ -0,0 +1,11 @@ + + + +Directory access is forbidden.
+ + + diff --git a/src/index.html b/src/index.html new file mode 100755 index 0000000..b702fbc --- /dev/null +++ b/src/index.html @@ -0,0 +1,11 @@ + + + +Directory access is forbidden.
+ + + diff --git a/libraries/Template.php b/src/libraries/Template.php similarity index 100% rename from libraries/Template.php rename to src/libraries/Template.php diff --git a/src/libraries/index.html b/src/libraries/index.html new file mode 100755 index 0000000..b702fbc --- /dev/null +++ b/src/libraries/index.html @@ -0,0 +1,11 @@ + + + +Directory access is forbidden.
+ + +