Hi...

Sooo.. no suggestions?

$categories = $this->Category->generatetreelist(null, null, null, '|--
', $recursive = -1 );

Looking to retrieve the extra field "Category.published" and display
it in my html table.

Should I use another find and merge them or something?

Using this in view:
<table class="data display">
                                        <thead>
                                                <tr>
                                                        <th 
style="text-align:center;"><?php __('Id');?></th>
                                                        <th><?php 
__('Name');?></th>
                            <th style="text-align:center;"><?php
__('Status');?></th>
                                                        <th 
style="text-align:center;"><?php __('Actions');?></th>
                                                </tr>
                                        </thead>
                                        <tbody>
<?php   $i = 0;
                foreach ($categories as $key=>$value):
                $class = null;
                if ($i++ % 2 == 0) {
                $class = 'odd';
                }
                $edit = $html->link($html->image("icons/16_icon_edit.png"),
array('action' => 'edit', $key), array('title'=>'Endre','escape' =>
false));
        $delete = $html->link($html->image("icons/
16_icon_delete.png"), array('action' => 'delete', $key),
array('valign'=>'center','class'=>'delete_trigger','rel'=>'#error','title'=>'Slett','escape'
=> false));
        ?>

    <tr class="<?php echo $class;?> gradeA">
    <td class="center"><?php echo $key; ?></td>
    <td><?php echo $value; ?></td>
    <td class="center">N/A</td>
    <td class="center"><?php echo $edit; ?> &nbsp;<?php echo $delete; ?
></td>
   </tr>
<?php endforeach; ?>
</tbody>
</table>


On 19 Okt, 18:48, MetZ <[email protected]> wrote:
> Hi all.
> I am wondering how I can retrieve an extra field from my rows using
> generatetreelist?
> $this->data = $this->Category->generatetreelist(null, null, null,
> '&nbsp;&nbsp;&nbsp;');
>
> The field I am looking for is "status", to display if the category is
> active or not.
>
> And,, btw.. I am using generatetreelist to list all nested categories
> in a html table with children.
> If u know of a better way to get all categories, and to put everything
> in an array to output in a html table, please let me know ;)
>
> Thanks for all and any help!
> Regards!
> -Tom

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to