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에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5677 |
패션리스트
|
10년 전 | 2382 | |
| 5676 |
패션리스트
|
10년 전 | 2345 | |
| 5675 | 10년 전 | 2270 | ||
| 5674 |
|
10년 전 | 1390 | |
| 5673 |
|
10년 전 | 2141 | |
| 5672 |
|
10년 전 | 1758 | |
| 5671 |
|
10년 전 | 2837 | |
| 5670 | 10년 전 | 1217 | ||
| 5669 |
|
10년 전 | 2014 | |
| 5668 | 10년 전 | 1106 | ||
| 5667 | 10년 전 | 1378 | ||
| 5666 |
|
10년 전 | 1725 | |
| 5665 |
|
10년 전 | 1277 | |
| 5664 |
|
10년 전 | 1010 | |
| 5663 | 10년 전 | 2461 | ||
| 5662 | 10년 전 | 1007 | ||
| 5661 |
AniNest
|
10년 전 | 2708 | |
| 5660 |
untitled
|
10년 전 | 2321 | |
| 5659 |
프로그래머7
|
10년 전 | 1713 | |
| 5658 |
untitled
|
10년 전 | 2326 | |
| 5657 |
untitled
|
10년 전 | 1853 | |
| 5656 |
untitled
|
10년 전 | 2613 | |
| 5655 |
|
10년 전 | 2727 | |
| 5654 | 10년 전 | 1392 | ||
| 5653 |
|
10년 전 | 1794 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기