https://github.com/krolow/cobaiaannotation
Annotations in CakePHP
https://github.com/krolow/cobaiaannotation
Last synced: 2 months ago
JSON representation
Annotations in CakePHP
- Host: GitHub
- URL: https://github.com/krolow/cobaiaannotation
- Owner: krolow
- Created: 2013-01-16T05:32:19.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-02-04T02:37:50.000Z (over 12 years ago)
- Last Synced: 2025-01-27T06:46:18.788Z (4 months ago)
- Language: PHP
- Size: 137 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
CobaiaAnnotation
================Annotations in CakePHP.
## Why?
- Because Annotations are cool!
- Because We like (or at least I like)
- Because no make sense repeate over and over the same code in PHP
- Use PHP array to configure is sux
- Metadata and Metaprogramming are cool!## Installing
CobaiaAnnotations make usage of composer, so download composer and create your
app/composer.json
```javascript
{
"name": "testing",
"require": {
"php": ">=5.3.0",
"cakephp/debug_kit" : "*",
"cobaia/cobaia-annotation": "dev-master"
},
"minimum-stability": "dev"
}
```It's time to running
composer.phar install
After install it's time to load the plugin, open
app/Config/bootstrap.php
```php
CakePlugin::load('CobaiaAnnotation', array('bootstrap' => true));//register filter
Configure::write('Dispatcher.filters', array(
'AssetDispatcher',
'CacheDispatcher',
'CobaiaAnnotation.AnnotationDispatcher'
));
```## What annotations do we have in CobaiaAnnotation?
### @ParamConverter
```php
Content->read(null, $content);
```### @ViewHandler
```php
$this->layout,$this->render()
, just define in the annotation what layout you want to use and also what view, and that's it.It makes also inheritance so if you define one layout or view in the class DocBlock, the actions will inherit the value.
### @ModelLoader, @ComponentLoader, @HelperLoader
```php
The MIT License
Redistributions of files must retain the above copyright notice.## Author
Vinícius Krolow - krolow[at]gmail.com