2014-11-19 2 views
0

내 Yii2 앱은 고급 템플릿을 기반으로합니다. 백엔드 측면에서 News라는 모델에 대해 CRUD를 만들었습니다.Yii2 CRUD URL 발행

는 지금은

/localhost/backend/web/index.php?r=News 요청 뉴스를 확인할 수 없습니다지고

을 열 때. 여기

Not Found (#404) 

Unable to resolve the request "News". 

는 구조입니다 :
backend 

models 
    News 

controllers 
    NewsController 

Views 
    News 
    index 
    _form 
    _search 
    create 
    update 
    view 

의 URL /localhost/backend/web/index.php?r=News

내가 잘못 뭐하는 거지

?

+0

여기에 컨트롤러뿐만 아니라 main.php를 게시하십시오. –

답변

1

보십시오 /localhost/backend/web/index.php?r=news 대소 문자를 구분합니다.

0

미하이 P는 문제는 경우의 아마 민감하지만 말했듯이 당신은 대문자의 어떤 이유로 필요를 위해, 당신은 단지 당신에게 그런 설정/main.php 파일을 변경할 수있는 경우 :

'components' => [ 
     'urlManager'=>[ 
      'rules'=>[ 
       'News'=>'/news', 
      ], 
      'enablePrettyUrl'=>true, 
     ], 
     ... 

그런 다음 /backend/web/index.php/News와 같은 URL을 보냅니다. index.php를 제거하려면 해당 방법을 제공하는 link을 살펴보십시오.