PHP 에서도 anotation 드리븐을 구현 할 수 있을거 같내요 ㅎ;
http://code.google.com/p/addendum/
잘만 활용 하면, spring framework 장점만 경량화 하여
php 진영에서도 ... framework 도 나오지 않을가 하는
생각을 문득 해봤습니다.
------------------------------------------------------------------
/** @Table("people") */
class Person {
// some code
}
$reflection = new ReflectionAnnotatedClass('Person'); // by class name
$reflection->getAnnotation('Table')->value; // contains string "people"
----------------------------------------------------------------------
class RolesAllowed extends Annotation {}
/** @RolesAllowed({'admin', 'web-editor'}) */
class CMS {
// some code
}
$reflection = new ReflectionAnnotatedClass('CMS');
$annotation = $reflection->getAnnotation('RolesAllowed');
$annotation->value; // contains array('admin', 'web-editor'
-------------------------------------------------------------
/** @Mapping(inheritance = @SingleTableInheritance, columns = {@ColumnMapping('id'), @ColumnMapping('name')}) */
class Person {}
$reflection = new ReflectionAnnotatedClass('Person');
$annotation = $reflection->getAnnotation('Mapping');
$annotation->inheritance; // SingleTableInheritance annotation
$annotation->columns; // array of ColumnMapping annotations
$annotation->columns[0]->value; // 'id'
게시판 목록
팁게시판
질문은 상단의 QA에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5652 | 10년 전 | 1296 | ||
| 5651 |
멋진남자임
|
10년 전 | 1409 | |
| 5650 | 10년 전 | 3106 | ||
| 5649 | 10년 전 | 1497 | ||
| 5648 |
멋진남자임
|
10년 전 | 2010 | |
| 5647 | 10년 전 | 5002 | ||
| 5646 | 10년 전 | 1733 | ||
| 5645 |
멋진남자임
|
10년 전 | 1887 | |
| 5644 | 10년 전 | 1555 | ||
| 5643 |
|
10년 전 | 1676 | |
| 5642 | 10년 전 | 2363 | ||
| 5641 | 10년 전 | 1473 | ||
| 5640 | 10년 전 | 1459 | ||
| 5639 | 10년 전 | 2388 | ||
| 5638 |
|
10년 전 | 3213 | |
| 5637 | 10년 전 | 3809 | ||
| 5636 | 10년 전 | 2098 | ||
| 5635 | 10년 전 | 1450 | ||
| 5634 | 10년 전 | 3340 | ||
| 5633 |
CHAVO
|
10년 전 | 1039 | |
| 5632 | 10년 전 | 2445 | ||
| 5631 | 10년 전 | 3199 | ||
| 5630 | 10년 전 | 1227 | ||
| 5629 | 10년 전 | 1332 | ||
| 5628 | 10년 전 | 2549 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기