Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
auto_literal disable do not work in inheritance template?

 
Post new topic   Reply to topic    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
jaceju
Smarty n00b


Joined: 25 Dec 2003
Posts: 3

PostPosted: Wed Dec 07, 2011 6:21 am    Post subject: auto_literal disable do not work in inheritance template? Reply with quote

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
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 4631
Location: Hamburg / Germany

PostPosted: Wed Dec 07, 2011 2:15 pm    Post subject: Reply with quote

This is a bug. it will be fixed ASAP.
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 4631
Location: Hamburg / Germany

PostPosted: Fri Dec 09, 2011 10:08 pm    Post subject: Reply with quote

The bugfix is now in the SVN trunk version and will later be included in 3.1.7
Back to top
View user's profile Send private message
jaceju
Smarty n00b


Joined: 25 Dec 2003
Posts: 3

PostPosted: Tue Aug 21, 2012 8:30 am    Post subject: Reply with quote

[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
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 4631
Location: Hamburg / Germany

PostPosted: Tue Aug 21, 2012 9:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
rodneyrehm
Administrator


Joined: 30 Mar 2007
Posts: 698
Location: Germany, border to Switzerland

PostPosted: Wed Aug 22, 2012 6:40 am    Post subject: Reply with quote

U.Tews wrote:
(a corresponding PHPunit test is now added)


yesssss! Smile
_________________
Twitter
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Bugs All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP