Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

bug with inner param in html_table ?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
BenFromTokyo
Smarty Rookie


Joined: 15 Oct 2004
Posts: 12
Location: Japan

PostPosted: Thu Jan 06, 2005 5:15 am    Post subject: bug with inner param in html_table ? Reply with quote

Hi,
Either I don't understand the "inner"param or there is a bug :

I get twice the same result here :

[php:1:db44fe8224]<?php
for($i=0;$i<13;$i++)
{
$array[] = "test $i";
}
$smarty->assign("array",$array);
?>[/php:1:db44fe8224]
Code:

{html_table loop=$array inner='rows'}
{html_table loop=$array inner='cols'}


Thanks for your help,
Ben
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Thu Jan 06, 2005 8:50 am    Post subject: Reply with quote

i get different results:

Code:

{html_table loop=$array inner=rows}:

<table border="1">
<tr>
<td>1</td>
<td>5</td>
<td>9</td>
</tr>
<tr>
<td>2</td>
<td>6</td>
<td>10</td>
</tr>
<tr>
<td>3</td>
<td>7</td>
<td>11</td>
</tr>
<tr>
<td>4</td>
<td>8</td>
<td>12</td>
</tr>
</table>




Code:

{html_table loop=$array inner=cols}:

<table border="1">
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td>4</td>
<td>5</td>
<td>6</td>
</tr>
<tr>
<td>7</td>
<td>8</td>
<td>9</td>
</tr>
<tr>
<td>10</td>
<td>11</td>
<td>12</td>
</tr>
</table>
Back to top
View user's profile Send private message Send e-mail Visit poster's website
BenFromTokyo
Smarty Rookie


Joined: 15 Oct 2004
Posts: 12
Location: Japan

PostPosted: Thu Jan 06, 2005 9:37 am    Post subject: Reply with quote

Hi,
Thank you for your quick reply, but it still does not work for me. This is quite weird...

I use Php 4.2.4 and Smarty 2.6.3

Here is all my code:

[php:1:3bbdbeb382]<?php
require_once("Smarty.class.php");

class MySmarty extends Smarty
{
function & MySmarty() {

//parent constructor
$this->Smarty();

//set the caching folders
$this->template_dir = SMARTY_ROOT.'templates/';
$this->compile_dir = SMARTY_ROOT.'templates_c/';

//unset the caching
$this->force_compile = true;
$this->caching = false;
}
}

for($i=1;$i < 6;$i++)
{
$array[] = $i;
}

$smarty = new MySmarty();
$smarty->assign("array",$array);
$smarty->display("test/index.tpl");

?>[/php:1:3bbdbeb382]

and my template (I tried with and without quotes):
Code:

{html_table loop=$array inner=rows}
{html_table loop=$array inner=cols}
{html_table loop=$array inner='rows'}
{html_table loop=$array inner='cols'}
 


and I get 4 times the same thing :
Code:


<table border="1">
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td>4</td>
<td>5</td>
<td>&</td>
</tr>
</table>



Where could the problem be ???
Confused
_________________
Ben
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Thu Jan 06, 2005 9:48 am    Post subject: Reply with quote

BenFromTokyo wrote:
Where could the problem be ???


there was a bug with "inner" that was fixed in Smarty-2.6.6 . i don't know why this isn't mentionend in the NEWS/Release-Notes of 2.6.6

upgrade your Smarty.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    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