Symfony 2.0으로 웹 사이트를 만들려고하고 있는데 extend("...") ?>
에서 <?php $this->extend("...") ?>
까지 문제가 있습니다.Symfony + PHP가 작동하지 않습니다.
사이트는 http://symfony.toxic-productions.com/install/web/poshpaws/hello에 볼 수 있습니다.
컨트롤러의 코드 :
는<?php
namespace Acme\HelloBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class HelloController extends Controller
{
public function indexAction($name)
{
//return $this->render('AcmeHelloBundle:Hello:index.html.twig', array('name' => $name));
// render a PHP template instead
return $this->render('AcmeHelloBundle:Hello:index.html.php', array('name' => $name));
}
}
?>
프론트 엔드 페이지의 코드 (index.html.php는)
<html>
<head>
<title>Poshpaws</title>
<?php
$view->extend('::base.html.php');
echo($head);
?>
</head>
<body>
<?php echo($body); ?>
<h1>This is just a page to say: Hello <?php echo $view->escape($name) ?>!</h1>
</body>
</html>
서버가 PHP가 설치되어 있지 않거나 최소한 정상적으로 작동하지 않는 시점에 나타납니다. 페이지의 소스를 보면' php'태그를 볼 수 있는데 이는 PHP가 그 파일을 전혀 파싱하지 않고 처리가 전혀 적용되지 않고 웹 서버에 의해 직접 제공되고 있음을 의미합니다. 올바른 파일을 부르시겠습니까? 죄송합니다. Symfony를 사용하지는 않았지만 직접 뷰를 호출하는 것처럼 보입니다. 컨트롤러가 호출되는 것 같지 않습니다. – drew010
PHP가 가장 확실하게 설치되었습니다. 독점적 인 "toxic-productions.com"에 가면 전체 PHP입니다. 그러나 모든 것이 VirtualHost에 구성되어 있는지 확인하겠습니다. – JohnHoulderUK
모든 요청을 처리하기위한'.htaccess' 파일이 올바른 위치에 있지 않을 수 있습니다. 그것은'web' 폴더에 있어야합니다. – drew010