COMING SOON 🚀

PHP ANOTATION , Reflection 입니다.

· 10년 전 · 1291

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,298
10년 전 조회 1,252
10년 전 조회 1,278
10년 전 조회 1,396
10년 전 조회 1,267
10년 전 조회 1,224
10년 전 조회 1,229
10년 전 조회 1,341
10년 전 조회 1,234
10년 전 조회 1,197
10년 전 조회 1,208
10년 전 조회 1,226
10년 전 조회 1,283
10년 전 조회 1,198
10년 전 조회 1,429
10년 전 조회 1,584
10년 전 조회 1,487
10년 전 조회 1,238
10년 전 조회 1,245
10년 전 조회 1,196
10년 전 조회 1,192
10년 전 조회 1,310
10년 전 조회 1,241
10년 전 조회 1,179
10년 전 조회 1,240
10년 전 조회 1,589
10년 전 조회 2,049
10년 전 조회 1,627
10년 전 조회 1,448
10년 전 조회 1,411
10년 전 조회 1,261
10년 전 조회 1,250
10년 전 조회 1,268
10년 전 조회 1,231
10년 전 조회 1,237
10년 전 조회 1,270
10년 전 조회 1,427
10년 전 조회 1,339
10년 전 조회 2,061
10년 전 조회 1,596
10년 전 조회 1,342
10년 전 조회 1,429
10년 전 조회 1,686
10년 전 조회 1,357
10년 전 조회 1,538
10년 전 조회 1,377
10년 전 조회 1,485
10년 전 조회 1,328
10년 전 조회 1,300
10년 전 조회 1,292
10년 전 조회 1,321
10년 전 조회 1,329
10년 전 조회 1,359
10년 전 조회 1,381
10년 전 조회 1,360
10년 전 조회 1,516
10년 전 조회 1,503
10년 전 조회 1,291
10년 전 조회 1,588
10년 전 조회 1,947
10년 전 조회 1,379
10년 전 조회 1,648
10년 전 조회 1,604
10년 전 조회 1,455
10년 전 조회 1,411
10년 전 조회 1,371
10년 전 조회 1,492
10년 전 조회 1,235
10년 전 조회 1,306
10년 전 조회 1,531
10년 전 조회 1,355
10년 전 조회 1,347
10년 전 조회 1,309
10년 전 조회 1,331
10년 전 조회 1,321
10년 전 조회 1,324
10년 전 조회 1,344
10년 전 조회 1,285
10년 전 조회 1,459
10년 전 조회 1,286
10년 전 조회 1,290
10년 전 조회 1,376
10년 전 조회 2,116
10년 전 조회 1,347
10년 전 조회 1,339
10년 전 조회 1,430
10년 전 조회 1,332
10년 전 조회 1,505
10년 전 조회 1,415
10년 전 조회 1,349
10년 전 조회 1,343
10년 전 조회 1,389
10년 전 조회 1,372
10년 전 조회 1,283
10년 전 조회 1,249
10년 전 조회 1,213
10년 전 조회 1,253
10년 전 조회 1,637
10년 전 조회 1,289
10년 전 조회 1,398