You need to pass the data that you want to use in the element:
$this->renderElement('browser_toolbar', $data_to_be_passed);
In your case, it would be the $paginator object.
-J.
On Apr 25, 5:38 pm, rob5408 <[EMAIL PROTECTED]> wrote:
> Sorry, most recent cake 1.2
>
> On Apr 25, 5:25 pm, rob5408 <[EMAIL PROTECTED]> wrote:
>
> > I have a block of html/php i need to show twice on the page, so i
> > thought i'd put it in an element. The content of the element is...
>
> > <div class="toolbar">
> > <table cellpadding="0" cellspacing="5px" border="0">
> > <tr>
> > <td><a href="#">< Prev</a> | <a href="#">Next ></a></
> > td>
>
> > <td><?php echo $paginator->counter(array('format' => __('Displaying
> > %start%-%end% of %count%', true))); ?></td>
>
> > <td>Jump to page
> > <?php
> > $pages = range(0, $paginator->params['paging']['Photo']
> > ['pageCount']); unset($pages[0]);
> > echo $form->input('page_selector', array('div' => '', 'label' => '',
> > 'options' => $pages));
> > ?>
> > <input type="submit" name="go_to_page" id="go_to_page" value="Go" />
> > </td>
>
> > <td><a href="#">Select All</a> | <a href="#">Select None</a></td>
> > <td><input name="unpublish_records" type="button" value="Unpublish
> > Selected" /> <input name="publish_records" type="button"
> > value="Publish Selected" /></td>
> > </tr>
> > </table>
> > </div><!-- /toolbar -->
>
> > AND I display it with this in my view...
>
> > <?php echo $this->renderElement('browser_toolbar'); ?>
>
> > However, it will only show up if i have both the renderElement line
> > ALONG with the element code, like this
>
> > <?php echo $this->renderElement('browser_toolbar'); ?>
> > <div class="toolbar">
> > <table cellpadding="0" cellspacing="5px" border="0">
> > <tr>
> > <td><a href="#">< Prev</a> | <a href="#">Next ></a></
> > td>
>
> > <td><?php echo $paginator->counter(array('format' => __('Displaying
> > %start%-%end% of %count%', true))); ?></td>
>
> > <td>Jump to page
> > <?php
> > $pages = range(0, $paginator->params['paging']['Photo']
> > ['pageCount']); unset($pages[0]);
> > echo $form->input('page_selector', array('div' => '', 'label' => '',
> > 'options' => $pages));
> > ?>
> > <input type="submit" name="go_to_page" id="go_to_page" value="Go" />
> > </td>
>
> > <td><a href="#">Select All</a> | <a href="#">Select None</a></td>
> > <td><input name="unpublish_records" type="button" value="Unpublish
> > Selected" /> <input name="publish_records" type="button"
> > value="Publish Selected" /></td>
> > </tr>
> > </table>
> > </div><!-- /toolbar -->
>
> > ...making it appear twice. If I remove the non-renderElement lines, an
> > error occurs which makes my page just turn empty and white. I know the
> > code in the element works because when they are there together, they
> > both display fine. What am i missing? It must be small and/or stupid
> > or i'm going crazy. Any ideas?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---