Skip to content

Commit

Permalink
initial fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
dandisy authored and dandisy committed Jan 31, 2016
1 parent 9b89630 commit 810a0c2
Show file tree
Hide file tree
Showing 73 changed files with 152 additions and 4,134 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,17 @@ atlassian-ide-plugin.xml
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties


### CodeIgniter template
*/config/development
*/logs/log-*.php
!*/logs/index.html
*/cache/*
!*/cache/index.html
!*/cache/.htaccess


### SublimeText template
# cache files for sublime text
*.tmlanguage.cache
Expand All @@ -68,13 +72,17 @@ crashlytics-build.properties

# sftp configuration file
sftp-config.json


### Composer template
composer.phar
vendor/

# Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock


### Eclipse template
*.pydevproject
.metadata
Expand Down
89 changes: 80 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,89 @@
# cihmvctwig
### rbz/codeigniter
#### The CodeIgniter Application Integrated with HMVC, Twig and Doctrine ORM

The CodeIgniter Framework including HMVC Extension and Twig Template Engine from Composer
1. Installation
* Git

### Installation :
##### Git
Clone this git project to your web root, go to cihmvctwig folder and run 'composer install'.
Clone this git project to your web root, go to the folder and run

##### Composer
Run 'composer create-project rbz/codeigniter:dev-master your-project-folder-name'
composer install

--------------------
* Composer

Just run in browser : your-hostname/cihmvctwig or your-project-folder-name/public
Run

composer create-project rbz/codeigniter:dev-master your-project-folder-name

or just run (to get the latest stable version)

composer create-project rbz/codeigniter your-project-folder-name

End than run in browser :

your-hostname/folder-name or your-project-folder-name/public

2. How to use Doctrine ORM
* To generate schema from entities (code first) :
- create entities in models/entities, example:

<?php
/**
* @Entity @Table(name="products")
**/
class Product
{
/** @Id @Column(type="integer") @GeneratedValue **/
protected $id;

/** @Column(type="string") **/
protected $name;

public function getId()
{
return $this->id;
}

public function getName()
{
return $this->name;
}

public function setName($name)
{
$this->name = $name;
}
}

- in terminal :

./vendor/bin/doctrine orm:schema-tool:create
* To generate entities from database (database first)
- in terminal :

first, generate the mapping annotation
./vendor/bin/doctrine orm:convert-mapping --from-database annotation models/mappings
then, generate the entities
./vendor/bin/doctrine orm:generate-entities --generate-annotations=true --generate-methods=true models/entities
last, ensure the generated class for entity not same with existing one(ei: controller class, or model class)
if same with other one, you need manually change:
- class name
- annotation refered
- file name

3. Using Twig

Twig implementation is set to read view with .twig as file extention in each module ,
if you want to Twig read other directory or file extention, you must change configuration in Twig.php library.

4. CodeIgniter Implementation

For security reason the index.php have been moved to public folder, and system file in outside web root directory.
You must set the web root directory to this public folder.

by [email protected]
6 changes: 0 additions & 6 deletions application/.htaccess

This file was deleted.

6 changes: 0 additions & 6 deletions application/cache/.htaccess

This file was deleted.

11 changes: 0 additions & 11 deletions application/cache/index.html

This file was deleted.

This file was deleted.

This file was deleted.

129 changes: 0 additions & 129 deletions application/config/autoload.php

This file was deleted.

Loading

0 comments on commit 810a0c2

Please sign in to comment.