From 9d3ae3647181d9a780f6b2c6f14b879c288dba65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Gaujard?= Date: Sat, 14 Oct 2017 14:29:20 +0200 Subject: [PATCH 1/8] Create editor config file --- .editorconfig | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .editorconfig 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 From 7393a36586df5dc4f0316fb3d097d3339feda001 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Gaujard?= Date: Sat, 14 Oct 2017 14:29:46 +0200 Subject: [PATCH 2/8] Create composer description file --- composer.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 composer.json diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..0376fa4 --- /dev/null +++ b/composer.json @@ -0,0 +1,7 @@ +{ + "name": "philsturgeon/codeigniter-template", + "description": "Template library for CodeIgniter which supports modules, themes, partial views, etc.", + "type": "library", + "minimum-stability": "stable", + "require": {} +} From ced75a1eea92dcf8175f73142a967b2b6f2c51be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Gaujard?= Date: Sat, 14 Oct 2017 14:30:57 +0200 Subject: [PATCH 3/8] Create gitignore file --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bad897d --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +# Composer +/composer.lock +/vendor/ + +# IDE +/.idea/ From ecbaa4d97af1b878ac7d0f9b9507ed12a445c443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Gaujard?= Date: Sat, 14 Oct 2017 14:37:51 +0200 Subject: [PATCH 4/8] Move ressource files to src folder --- {config => src/config}/autoload.php | 0 {config => src/config}/template.php | 0 {libraries => src/libraries}/Template.php | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename {config => src/config}/autoload.php (100%) rename {config => src/config}/template.php (100%) rename {libraries => src/libraries}/Template.php (100%) 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/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/libraries/Template.php b/src/libraries/Template.php similarity index 100% rename from libraries/Template.php rename to src/libraries/Template.php From f1b5288786564c4b281b1798c85ae2505d25c616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Gaujard?= Date: Sat, 14 Oct 2017 14:38:50 +0200 Subject: [PATCH 5/8] Add index.html file for avoid direct access --- index.html | 11 +++++++++++ src/config/index.html | 11 +++++++++++ src/index.html | 11 +++++++++++ src/libraries/index.html | 11 +++++++++++ 4 files changed, 44 insertions(+) create mode 100755 index.html create mode 100755 src/config/index.html create mode 100755 src/index.html create mode 100755 src/libraries/index.html diff --git a/index.html b/index.html new file mode 100755 index 0000000..b702fbc --- /dev/null +++ b/index.html @@ -0,0 +1,11 @@ + + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + + 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 @@ + + + + 403 Forbidden + + + +

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 @@ + + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + + 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 @@ + + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + + From fcd42233d6d4e22416c86799154dabfcd46c2ffc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Gaujard?= Date: Sat, 14 Oct 2017 15:00:59 +0200 Subject: [PATCH 6/8] Update README: Installation instruction --- README.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) 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. From d46c8e5b283c189f9c35fb0b4eb5e22edaa0f6ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Gaujard?= Date: Sat, 14 Oct 2017 15:11:16 +0200 Subject: [PATCH 7/8] Create an empty controller for demo --- composer.json | 4 ++- src/controllers/Template_controller.php | 34 +++++++++++++++++++++++++ src/controllers/index.html | 11 ++++++++ 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 src/controllers/Template_controller.php create mode 100755 src/controllers/index.html diff --git a/composer.json b/composer.json index 0376fa4..3b4cf3a 100644 --- a/composer.json +++ b/composer.json @@ -3,5 +3,7 @@ "description": "Template library for CodeIgniter which supports modules, themes, partial views, etc.", "type": "library", "minimum-stability": "stable", - "require": {} + "require": { + "php" : ">=5.2" + } } 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 @@ + + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + + From c3250dc80318406d3097781292f0fb0a82e64994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Gaujard?= Date: Sat, 14 Oct 2017 17:23:33 +0200 Subject: [PATCH 8/8] Omit some OS files --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index bad897d..ae181fb 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ # IDE /.idea/ + +# OS Files +.DS_Store