Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Composer
/composer.lock
/vendor/

# IDE
/.idea/

# OS Files
.DS_Store
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.


Expand All @@ -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.
9 changes: 9 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
11 changes: 11 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>

<p>Directory access is forbidden.</p>

</body>
</html>
File renamed without changes.
11 changes: 11 additions & 0 deletions src/config/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>

<p>Directory access is forbidden.</p>

</body>
</html>
File renamed without changes.
34 changes: 34 additions & 0 deletions src/controllers/Template_controller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

/**
* Class Template_controller
* copy this file in your directory /application/controllers
*/
class Template_controller extends CI_Controller
{
public function __construct()
{
parent::__construct();

$this->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');
}

}
11 changes: 11 additions & 0 deletions src/controllers/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>

<p>Directory access is forbidden.</p>

</body>
</html>
11 changes: 11 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>

<p>Directory access is forbidden.</p>

</body>
</html>
File renamed without changes.
11 changes: 11 additions & 0 deletions src/libraries/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>

<p>Directory access is forbidden.</p>

</body>
</html>