CodeIgniter Forums
BackendPro 0.6.1 - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Libraries & Helpers (
+--- Thread: BackendPro 0.6.1 (/showthread.php?tid=7381)

BackendPro 0.6.1 - El Forum - 12-22-2008

Load the page module? Do you mean like this?

I can't find any docs on loading modules - I guess it's got to be a matchbox thing? Doesn't the parent:Tongueublic_Controller(); line load the page functions?

I get a nice X from the line
. That means the page module is loaded doesn't it?

BackendPro 0.6.1 - El Forum - 12-22-2008

Well, you haven't been very specific about which controllers, which views, where your controller extends from etc. I recall that Adam refactored a bit so that some of the resources required for the backend are not automatically loaded through auto_load any more. As such I was just suggested that you verify that the page module had been loaded. You probably should be able to check your logs to see what all was loaded and what wasn't, matchbox reports that to the log file.

BackendPro 0.6.1 - El Forum - 12-22-2008

Wooops, sorry I see that you do mention something about errors, etc. I would just suggest you verify that the page module is loaded. The log file should report that it got loaded, either matchbox will report or possibly the page library.

BackendPro 0.6.1 - El Forum - 12-22-2008

Page constructor function has check your logs (make sure the reporting is set for that level to show up).
log_message('debug', "Page Class Initialized");

BackendPro 0.6.1 - El Forum - 12-22-2008


DEBUG - 2008-12-23 01:04:30 --> Page Class Initialized

and later on:

DEBUG - 2008-12-23 01:04:30 --> Breadcrumb link "foo" pointing to "baz/foo" created
DEBUG - 2008-12-23 01:04:30 --> Breadcrumb link "bar" pointing to "baz/bar" created

and the last line of the log before death:

DEBUG - 2008-12-23 01:04:30 --> File loaded: /Users/will/Sites/dev/system/application/../../modules/baz/views/public/v_menu.php

interestingly, v_menu is the page before the one that calls the output_trail()

I'm not sure where to look to track this down. There is nothing in apache's error log :-(

BackendPro 0.6.1 - El Forum - 12-22-2008

Can you set a breakpoint and step through with your debugger?

BackendPro 0.6.1 - El Forum - 12-22-2008

Ok, I got php's logging going, and this is what's causing it:

[23-Dec-2008 01:33:01] PHP Fatal error: Call to undefined method Page::output_trail() in /Users/will/Sites/dev/modules/baz/views/public/v_in.php on line 5

and line 5 is:
<?php $this->page->output_trail(); ?>

A quick grep of the source (for _trail) shows:
modules/page/libraries/Page.php:132: $this->breadcrumb_trail[$name] = $link;
modules/page/libraries/Page.php:169: foreach ( $this->breadcrumb_trail as $name => $link )
modules/page/libraries/Page.php:171: if ( $i == count($this->breadcrumb_trail) ) {

None of which look like functions.

There is a function output_breadcrumb(), but it doesn't print anything for me.

BackendPro 0.6.1 - El Forum - 12-22-2008

instead of output_trail try output_breadcrumb

BackendPro 0.6.1 - El Forum - 12-23-2008

OK, I worked it out - all it took was some sleep Smile Sometimes I surprise myself how thick I can be when I'm tired.

The documentation is incorrect.
does not exist. The correct call is
, however this just returns the actual trail, not the trail wrapped in a div as the docs suggest. The corect syntax is therefore:

//this bit in the controller or such

<!-- this bit in the view file -->
<div id='breadcrumb'>

Adam: I'm not sure if you meant to write the output_trail function as a wrapper for output_breadcrumb or not, if so you haven't done it yet. It's such a small bit of code it's probably easier to write it than change the documentation, in fact here you go:
from modules/page/libraries/Page.php line 158
         * Output Wrapped Breadcrumb Trail
         * @access public
         * @param boolean $print Prints string to page instead of returning it
         * @return string
        function output_trail($print=TRUE)
            $output = '<div id="breadcrumb">';
            $output .= $this->output_breadcrumb(FALSE);
            $output .= '</div>';
            // Print/Output trail
            if ($print){
                print $output;
            return $output;

BackendPro 0.6.1 - El Forum - 12-24-2008

Sorry for not getting back sooner. I saw the bug report on this and have changed the documentation. Personally I'm not sure If I want to force the user to use my wrapper for the breadcrumb.

What I may do is allow them to decided whether to output a wrapper or not.