2011-12-01 3 views
0

Zend Framework 표준에 따라 Zend_Layout을 사용하고 있습니다. 여기Zend layout.html 출력의 줄 바꿈과 흰색 선

[production] 
phpSettings.display_startup_errors = 0 
phpSettings.display_errors = 0 
includePaths.library = APPLICATION_PATH "/../library" 
bootstrap.path = APPLICATION_PATH "/Bootstrap.php" 
bootstrap.class = "Bootstrap" 
appnamespace = "Application" 
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers" 
resources.frontController.params.displayExceptions = 0 

resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/" 
[staging : production] 

[testing : production] 
phpSettings.display_startup_errors = 1 
phpSettings.display_errors = 1 

[development : production] 
phpSettings.display_startup_errors = 1 
phpSettings.display_errors = 1 
resources.frontController.params.displayExceptions = 1 

layout.phtml의 상황이다 : 그것은 여기

있어

zf create project demo 
cd demo 
zf enable layout 

내 설정이다

<?= $this->doctype() ?> 

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
    <head> 
     <?= $this->headMeta(); ?> 


     <?= $this->headTitle(); ?> 

    </head> 

출력 :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />  <title>Dashboard</title>  </head> 

내 문제는 모든 줄 바꿈과 흰색 선이 제거됩니다. 어떻게 돌려받을 수 있을까요?

그러나 "echo $ this-> layout() -> content"의 출력은 괜찮습니다 (줄 바꿈과 흰색 줄이 여전히 있음).

+0

귀하의 경우에는 Zend 나 PHP에 의해 삭제되지 않습니다. 대부분 소스를 보는 프로그램에서 제거됩니다. 줄 바꿈을 적절하게 처리하도록 시스템을 구성하기 만하면됩니다. UNIX 또는 OSX 줄 바꿈이 있지만 Windows 편집기에서 원본을 볼 수 있습니까? – hakre

+0

@hakre 나는 unbutu의 VIM에 소스를 보았습니다. – Lance

답변

0
<?= $this->doctype() ?> 

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
<head> 
    <?= $this->headMeta(); ?> 

    <?= $this->headTitle(); ?> 

</head> 

보기 헬퍼 뒤에 빈 줄을 추가하기 만하면됩니다.

+0

이것은 html 이후와 head 이전에 누락 된 줄 바꿈을 설명하지 않으므로 해결책이 아닙니다. – hakre

+0

한번에 동일한 문제를 해결하는 데 도움이되므로 약간의 경험을 공유하십시오. –

+0

비슷한 문제를 해결할 수 있지만 OP가 가진 문제는 아닌 것 같습니다. 그게 전부입니다. – hakre

0

setIndent(), setPostfix() 및 들여 쓰기 및 새 줄에 대해 신경을 쓰지 않는 것이 대답 인 것 같습니다.

setIndetn() 및 setPostfix()는 설명서에 다소 설명되어 있습니다 (헬퍼는 PlaceHolder 클래스에서 이러한 메서드를 상속받습니다). http://framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers.initial.placeholder

사용 예

관련 문제