|
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 |
BenFromTokyo Smarty Rookie
Joined: 15 Oct 2004 Posts: 12 Location: Japan
|
Posted: Thu Jan 06, 2005 5:15 am Post subject: bug with inner param in html_table ? |
|
|
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 |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Thu Jan 06, 2005 8:50 am Post subject: |
|
|
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 |
|
BenFromTokyo Smarty Rookie
Joined: 15 Oct 2004 Posts: 12 Location: Japan
|
Posted: Thu Jan 06, 2005 9:37 am Post subject: |
|
|
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 ???
_________________ Ben |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Thu Jan 06, 2005 9:48 am Post subject: |
|
|
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 |
|
|
|
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
|