2013-05-23 2 views
1

이 같은 구조의 폴더가 있습니다
Zend - masterpae asp.net과 같은보기에 파일을 포함시키는 방법?

http://nx9.upanh.com/b4.s37.d4/3fd103509d1ac25ece02096b5e25a5f0_55810779.capture.png
(정말 미안 해요, 난 충분하지 않은 평판)

나는이 개 파일을 포함 할

는 대중 header.phtml 및 footer.phtml됩니다/기본 모듈의 뷰/폴더 공유, 나는 아래의 코드를 사용합니다

<?php echo $this->partial('public/shared/header.phtml'); ?> 

<h3>This is index.phtml</h3> 

<?php echo $this->partial('public/shared/footer.phtml'); ?> 

을하지만 오류를 HTTP 500 (내부 서버 오류)를 얻을. 내가 html 코드만을 사용하고 있다면 문제는 발생하지 않는다.

<h3>This is index.phtml</h3> 

내가 CodeIgniter의 프레임 워크에서 다음과 같이 할 수 있지만 내가 젠드 프레임 워크에서이 작업을 수행하는 방법을 모르겠어요. 제발 도와주세요! 너무 감사합니다.

답변

0

ZF1 또는 2를 사용하고 있습니까? ZF1에서는 header/footer를 application/layouts/scripts/layout.phtml에있는 layout.phtml 파일에 넣을 수 있습니다.

LAYOUT.PHTML :

<?php echo $this->partial('header.phtml') ?> 

// this bit will render the action content 
<?php print $this->layout()->content ?> 

<?php echo $this->partial('footer.phtml') ?> 
+0

감사

실제 header.phtml 및 footer.phtml

는 다음과 같은 작업을 수행 할 수 있습니다, 응용 프로그램 /보기/스크립트 폴더에 위치해야합니다! 당신의 대답을 봅니다. –

+0

그러나 어디에서 layout.phtml을 호출 할 수 있습니까? –

+0

layout.phtml을 호출 할 필요가 없습니다. 부트 스트랩은 그것을 관리해야합니다. 튜토리얼 또는 두 가지를 읽지 않는 이유는 무엇입니까? http://akrabat.com/zend-framework-tutorial/을 참조하십시오. – Rijndael

관련 문제