|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
jaceju Smarty n00b
Joined: 25 Dec 2003 Posts: 3
|
Posted: Wed Dec 07, 2011 6:21 am Post subject: auto_literal disable do not work in inheritance template? |
|
|
Dear all:
I tried the code below to test template inheritance:
index.php:
Code: | <?php
require_once __DIR__ . '/Smarty/Smarty.class.php';
$smarty = new Smarty();
$smarty->addTemplateDir(__DIR__ . '/templates');
$smarty->setCompileDir(__DIR__ . '/compiled');
$smarty->auto_literal = false;
$smarty->left_delimiter = '<%';
$smarty->right_delimiter = '%>';
$smarty->display('index.phtml'); |
layout.phtml:
Code: | <!DOCTYPE html>
<html lang="zh-TW">
<head>
<meta charset="utf-8" />
<title>Smarty Test</title>
</head>
<body>
<% block name="content" %><% /block %>
</body>
</html> |
index.phtml:
Code: | <% extends file="layout.phtml" %>
<% block name="content" %>
<h1>TEST</h1>
<% /block %> |
But the block#content in layout.phtml cannot be replaced by index.phtml.
Then I try to remove the spaces in block tags:
index.phtml:
Code: | <% extends file="layout.phtml" %>
<%block name="content"%>
<h1>TEST</h1>
<%/block%> |
and it works finally.
Is it an auto_literal defect in inheritance template?
---
Sorry for my poor English. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed Dec 07, 2011 2:15 pm Post subject: |
|
|
This is a bug. it will be fixed ASAP. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri Dec 09, 2011 10:08 pm Post subject: |
|
|
The bugfix is now in the SVN trunk version and will later be included in 3.1.7 |
|
Back to top |
|
jaceju Smarty n00b
Joined: 25 Dec 2003 Posts: 3
|
Posted: Tue Aug 21, 2012 8:30 am Post subject: |
|
|
[quote="U.Tews"]The bugfix is now in the SVN trunk version and will later be included in 3.1.7[/quote]
Hi, The bug still exists on 3.1.11. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Aug 21, 2012 9:57 pm Post subject: |
|
|
For some reason this problem was reintroduced by other patches after the 3.1.7 release.
It's now fixed again in the SVN trunk version and the fix will later be included in 3.1.12.
(a corresponding PHPunit test is now added) |
|
Back to top |
|
rodneyrehm Administrator
Joined: 30 Mar 2007 Posts: 674 Location: Germany, border to Switzerland
|
Posted: Wed Aug 22, 2012 6:40 am Post subject: |
|
|
U.Tews wrote: | (a corresponding PHPunit test is now added) |
yesssss! _________________ Twitter |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|