Home > Archive > PHP Smarty Templates > October 2006 > Re: [SMARTY] example not working...
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: [SMARTY] example not working...
|
|
| Michael Kolakowski 2006-10-12, 7:11 pm |
| Thanks for the help, Ken. However, I now have a couple new questions.
First: There is a th_attr attribute listed for html_table (link
below). I cannot get it to work. I tried using a string and assigning
an array in the php file to be passed to the template. Neither worked.
Second: I also tried, on a whim, to use the caption attribute. It
seems fairly simple, but again, it does not work. My line looks like this:
{html_table loop=$tableData cols=2 caption="hello"
table_attr='border="2"' tr_attr=$colors}
For what it's worth, I am getting a bit frustrated with html_table as
things do not seem to be working as advertised. I would either
appreciate corrections to the documentation or more examples showing how
things work - e.g. and example using *all* the attributes for whatever
function it is.
Note: I am aware this is open source and many work very hard and
volunteer. I fully respect that. I am not trying to be mean, just
trying to give some feedback from a new user's point of view. That is
important if you want people to adopt your product. By the way - I do
like Smarty so far...very indeed.
Thank you much,
Michael Kolakowski
Ken Snyder wrote:
> It appears that the documentation is incorrect. Using version 2.6.14,
> the cols parameter is only used as an integer. It has no
> functionality to pass in column names or do <th> at all. You might
> try a custom plugin from one of the plugin repositories.
>
> Ken
>
> From plugins/function.html_table.php
>
> $loop_count = count($loop);
> if (empty($params['rows'])) {
> /* no rows specified */
> $rows = ceil($loop_count/$cols);
> } elseif (empty($params['cols'])) {
> if (!empty($params['rows'])) {
> /* no cols specified, but rows */
> $cols = ceil($loop_count/$rows);
> }
> }
>
> Michael Kolakowski wrote:
>
>
| |
|
| Will look into this and correct as soon as possible.
Pete
Michael Kolakowski wrote:[color=darkred]
> Thanks for the help, Ken. However, I now have a couple new questions.
>
> First: There is a th_attr attribute listed for html_table (link
> below). I cannot get it to work. I tried using a string and assigning
> an array in the php file to be passed to the template. Neither worked.
>
> Second: I also tried, on a whim, to use the caption attribute. It
> seems fairly simple, but again, it does not work. My line looks like this:
>
> {html_table loop=$tableData cols=2 caption="hello"
> table_attr='border="2"' tr_attr=$colors}
>
> For what it's worth, I am getting a bit frustrated with html_table as
> things do not seem to be working as advertised. I would either
> appreciate corrections to the documentation or more examples showing how
> things work - e.g. and example using *all* the attributes for whatever
> function it is.
>
> Note: I am aware this is open source and many work very hard and
> volunteer. I fully respect that. I am not trying to be mean, just
> trying to give some feedback from a new user's point of view. That is
> important if you want people to adopt your product. By the way - I do
> like Smarty so far...very indeed.
>
> Thank you much,
> Michael Kolakowski
>
>
>
> Ken Snyder wrote:
|
|
|
|
|