2014-07-12 1 views
0

yii 프레임 워크에서 문서 업로드 문제가 있습니다. 나는 성공할 수 있도록 yii 컨셉을 사용하여 업로드를 시도했다.코어 PHP 모듈을 yii 프레임 워크로 가져 오는 방법은 무엇입니까?

핵심 PHP 개념을 사용했습니다. 별도의 코어 PHP 폴더로 코어 PHP에 업로드합니다.

하지만 핵심 PHP 모듈을 yii 프레임 워크로 가져 오십시오. 내가

<form method="post" action="<?php Yii::import('application.controllers.submitForm.php');?>" id="frmContact" name="frmContact" enctype="multipart/form-data"> 
      <span id="responseMessage"></span><br/> 
      <fieldset class="formClass" id="formClass"> 
        <p> 
         <label>Name: </label> 
       <input type="text" name="name"> 
       </p> 

       <p> 
       <label>Document: </label> 
       <input type="file" name="updDocument"><br/><br/> 
       <span class="docFormate">Only JPG,PNG and DOC allowed with less than 2MB size.</span> 
       </p> 
       <p> 
         <label>Message: </label> 
       <textarea name="message"></textarea> 
       </p> 
       <p> 
         <span id="submitBtn"> 
      <input type="submit" name="submitForm" value="Submit" class="button marL114" onclick="return validForm()"> 
      <input type="reset" name="reset" value="Reset" class="button"> 
         </span> 
         <span id="flashShow"></span> 
       </p> 
      </fieldset> 
     </form> 
</div> 

submitForm.php 내가 가져올 수있는 방법 파일을 실행하는 것이

그래서 컨트롤러 폴더에 존재

<?php Yii::import('application.controllers.submitForm.php');?> 

형태

처럼 아래에 언급처럼 내가 YII :: 수입 방법을하시기 바랍니다 사용 나에게 적합한 대답을 제안 해주세요 `

답변

0

Yii::import()

01에 대한 문서에서

클래스 또는 디렉토리를 가져옵니다.

당신은 그러므로 Yii::app()->createUrl() 또는 CController::createUrl()가 사용되어야 URL을 만들기 위해 노력하고 있습니다.

을 그러나

당신이 잘못 YII을 사용하고 있습니다. submitForm.php은 컨트롤러 여야합니다. protected 폴더의 파일은 URL을 통해 직접 액세스 할 수 없습니다.