내가 PHP 프레임 워크로 CodeIgniter를 사용하던 찾을 coul, 내 모델 수업을 넣고 난 CI 대신 SF를 배울하기로 결정했다. CI가 새 버전 업데이트를 중단했기 때문에.symfony2 - WI 내가 그것을
내가 -src 자격증 신청인 -PostBundle -PostController -CommentController
......
이 내가 Post_model라는 모드를 사용합니다. 모델 파일에 내가 이러한 기능을 사용하려면 Post_model 클래스에서
,class Post_model {
public function LastTenPosts() {
$posts= $this->getDoctrine()
->getRepository('PostPostBundle:Posts')
.................. etc ...........
}
public function MostPopulerPosts() {
/* I want to use doctrine in theese functions */
}
public function MostCommentedPosts() {
}
}
, 내 DB에서 데이터를 연결하고 얻을 교리 기능을 사용하고 싶습니다.
어디에 내 Post_mode.php 파일을 SF에 넣어야하고 어떻게 모델에서 doctrine을 사용할 수 있습니까? 어떻게 교리 함수를 포함시킬 수 있습니까?
도움을 주셔서 감사합니다.
당신은 정말 [문서]를 읽어야합니다 (http://symfony.com/doc/current/book/doctrine.html) –