******************************************
윈도우 환경에서 helloworld 찍어보기
******************************************
yii가 설치 되어있다는 가정하에 시작합니다.
******************************************
cmd 창 실행
-------------
C:\APM_Setup\htdocs\yii>framework\yiic webapp C:\APM_Setup\htdocs\helloworld
-------------
"어쩌고 저쩌고~~~ 또는 배치파일이 아닙니다"
Create a web 불라불라 ~~ yes : no) [no]:
코멘트가 보인다
-------------
그러면
Create a web 불라불라 ~~ yes : no) [no]: yes
yes 입력후 실행
-------------
your application has been created sucessfully under C:\APM_Setup\htdocs\helloworld
코멘트가 보인다
윈도우 탐색기를 통해
C:\APM_Setup\htdocs\yii 와 동일레벨에
C:\APM_Setup\htdocs\helloworld 폴더가 생성되고 폴더안에 이것저것 들어있는 것을 확인할 수 있다.
-------------
인터넷브라우저를 열고
본인 호스트
http://127.0.0.1/helloworld/
로 접근하여 웰컴 메시지 확인
-------------
C:\APM_Setup/htdocs/helloworld/protected/controllers 를 들어가 보면
기본 controller인
SiteController.php 만 보일것이다.
hello를 찍기 위해서 새로운controller를 생성한다.
C:\APM_Setup/htdocs/helloworld/protected/controllers/
MessageController.php
*************************************************************
class MessageController extends Controller
{
public $defaultAction = 'hello';
public function actionHello()
{
$this->render('hello'); // hello.php 를 찾는다.
}
}
*************************************************************
연동되는 VIEW를 만들기 위해서
C:\APM_Setup/htdocs/helloworld/protected/views/ 하위에
/message/ 폴더를 생성한다.
(이때 폴더명이 중요하다.
MessageController 와 연동되기 때문에 message라고 네이밍 해야함)
------------------------------------------------------------
C:\APM_Setup/htdocs/helloworld/protected/views/message/
hello.php 를 생성한다.
*************************************************************
Hello World!
*************************************************************
url로 접근해본다.
**방법01 (디펄트 화면으로 접근)
http://192.168.2.243/helloworld/index.php?r=message
**방법02 (컨트롤러명(message)과 평션명(hello)으로 접근):
http://192.168.2.243/helloworld/index.php?r=message/hello
**방법03 ('index.php?r='없이 접근)
http://127.0.0.1/helloworld/?r=message
******************************************************************
끝~~~~ 감사합니다.
******************************************************************