-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
dandisy
authored and
dandisy
committed
Jan 31, 2016
1 parent
9b89630
commit 810a0c2
Showing
73 changed files
with
152 additions
and
4,134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
39 changes: 0 additions & 39 deletions
39
...cation/cache/twig/60/601c1939f0960e5c72fd82316bd23e11af0d5a2e42ec240d6793e35ec60320ae.php
This file was deleted.
Oops, something went wrong.
39 changes: 0 additions & 39 deletions
39
...cation/cache/twig/75/75498f550725a95d3a6697bd02612e6903ff85cbfe6ccf33089991007590ef13.php
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.