@jeremy,

The script creates a dynamic table containing images pulled from the
database. The number of columns are adjustable depending on space
requirements and the line in question ends the row and starts another when
it reaches the designated number of columns.

[code]

$num_of_cols = 6;

echo
$html->tag('table', null, array(
  'cellspacing' => 0,
  'cellpadding' => 5,
  'border' => 0
  )
   )
.$html->tag('tr');

foreach($photos as $photo)
{
echo ($i!= 0 && $i%$num_of_cols == 0)?'</tr><tr>':'';
echo $html->tag('td', null, array(
      'valign' => 'top'
     )
)
.$html->tag('a href="/photos/view/'.$photos[$j++]['Photo']['id'].'"')
.$html->tag('img', null, array(
  'src' => Router::url(array(
       'controller' => 'photos',
       'action' => 'displayPhotos/'.$photos[$k++]['Photo']['id']
      )
                              ),
  'height' => 90
 )
   )
.$html->tag('/a')
.$html->tag('/td');
$i++;
}

echo $html->tag('/tr')
.$html->tag('/table');

[/code]

On Sat, May 15, 2010 at 2:30 AM, Bogdan Bursuc <[email protected]>wrote:

> I think you should consider taking a better look at the HtmlHelper, if you
> want all cake. It's now laughable I use it myself.
> http://api13.cakephp.org/class/html-helper
>
> On Sat, May 15, 2010 at 9:26 AM, Ed Propsner <[email protected]> wrote:
>
>> For most of you this is going to seem so trivial that it's almost
>> laughable so laugh if you must :)
>>
>> I wanted to see how far I could make it through a site without using a
>> single standard <tag> ... it's all cake.
>>
>> All arguments aside, I think the gig is up.
>>
>> [code]
>>
>> foreach($photos as $photo)
>> {
>> echo ($i!= 0 && $i%$num_of_cols == 0)?'</tr><tr>':'';
>> <------------------
>> echo $html->tag('td', null, array(  ....
>>
>> [/code]
>>
>> I can't find a way around it.
>>
>> - Ed
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>>
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]<cake-php%[email protected]>For
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>
>
> --
> Bogdan Iulian Bursuc
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<cake-php%[email protected]>For
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to