COMING SOON 🚀

PHP ANOTATION , Reflection 입니다.

· 10년 전 · 1304

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'

|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
10년 전 조회 1,306
10년 전 조회 1,268
10년 전 조회 1,284
10년 전 조회 1,403
10년 전 조회 1,274
10년 전 조회 1,229
10년 전 조회 1,238
10년 전 조회 1,352
10년 전 조회 1,245
10년 전 조회 1,202
10년 전 조회 1,217
10년 전 조회 1,231
10년 전 조회 1,289
10년 전 조회 1,208
10년 전 조회 1,439
10년 전 조회 1,595
10년 전 조회 1,495
10년 전 조회 1,247
10년 전 조회 1,250
10년 전 조회 1,207
10년 전 조회 1,205
10년 전 조회 1,319
10년 전 조회 1,247
10년 전 조회 1,189
10년 전 조회 1,248
10년 전 조회 1,597
10년 전 조회 2,063
10년 전 조회 1,633
10년 전 조회 1,465
10년 전 조회 1,421
10년 전 조회 1,270
10년 전 조회 1,260
10년 전 조회 1,275
10년 전 조회 1,237
10년 전 조회 1,253
10년 전 조회 1,279
10년 전 조회 1,437
10년 전 조회 1,350
10년 전 조회 2,068
10년 전 조회 1,602
10년 전 조회 1,355
10년 전 조회 1,440
10년 전 조회 1,698
10년 전 조회 1,367
10년 전 조회 1,544
10년 전 조회 1,386
10년 전 조회 1,493
10년 전 조회 1,339
10년 전 조회 1,305
10년 전 조회 1,305
10년 전 조회 1,337
10년 전 조회 1,341
10년 전 조회 1,373
10년 전 조회 1,399
10년 전 조회 1,368
10년 전 조회 1,524
10년 전 조회 1,516
10년 전 조회 1,298
10년 전 조회 1,596
10년 전 조회 1,954
10년 전 조회 1,393
10년 전 조회 1,656
10년 전 조회 1,617
10년 전 조회 1,470
10년 전 조회 1,418
10년 전 조회 1,383
10년 전 조회 1,505
10년 전 조회 1,242
10년 전 조회 1,320
10년 전 조회 1,542
10년 전 조회 1,361
10년 전 조회 1,359
10년 전 조회 1,314
10년 전 조회 1,346
10년 전 조회 1,334
10년 전 조회 1,337
10년 전 조회 1,363
10년 전 조회 1,296
10년 전 조회 1,472
10년 전 조회 1,298
10년 전 조회 1,299
10년 전 조회 1,393
10년 전 조회 2,126
10년 전 조회 1,365
10년 전 조회 1,351
10년 전 조회 1,440
10년 전 조회 1,346
10년 전 조회 1,526
10년 전 조회 1,428
10년 전 조회 1,356
10년 전 조회 1,352
10년 전 조회 1,398
10년 전 조회 1,381
10년 전 조회 1,293
10년 전 조회 1,262
10년 전 조회 1,232
10년 전 조회 1,263
10년 전 조회 1,655
10년 전 조회 1,298
10년 전 조회 1,410