Welcome Guest, Not a member yet? Register   Sign In
BackendPro 0.6.1

[eluser]woleium[/eluser]
Load the page module? Do you mean like this?
Code:
$this->load->module_library('page','page');

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
Code:
<?=$this->page->icon('cross')?>
. That means the page module is loaded doesn't it?

[eluser]a&w[/eluser]
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.

[eluser]a&w[/eluser]
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.

[eluser]a&w[/eluser]
Page constructor function has this....so check your logs (make sure the reporting is set for that level to show up).
Code:
log_message('debug', "Page Class Initialized");

[eluser]woleium[/eluser]
Yup:

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 :-(

[eluser]a&w[/eluser]
Can you set a breakpoint and step through with your debugger?

[eluser]woleium[/eluser]
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:
Code:
<?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.

[eluser]a&w[/eluser]
instead of output_trail try output_breadcrumb

[eluser]woleium[/eluser]
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.
Code:
$this->page->output_trail();
does not exist. The correct call is
Code:
$this->page->output_breadcrumb()
, however this just returns the actual trail, not the trail wrapped in a div as the docs suggest. The corect syntax is therefore:

Code:
<?php
//this bit in the controller or such
$this->page->set_crumb('foo','baz/foo');
$this->page->set_crumb('bar','baz/bar');
?>

<!-- this bit in the view file -->
<div id='breadcrumb'>
    &lt;?=$this->page->output_breadcrumb()?&gt;
</div>


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
Code:
/**
         * 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;
            }
            return $output;
        }

[eluser]adamp1[/eluser]
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.




Theme © iAndrew 2016 - Forum software by © MyBB