Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toolbar won't accept custom collectors #1971

Closed
MGatner opened this issue Apr 24, 2019 · 0 comments
Closed

Toolbar won't accept custom collectors #1971

MGatner opened this issue Apr 24, 2019 · 0 comments

Comments

@MGatner
Copy link
Member

MGatner commented Apr 24, 2019

The User Guide outlines creating a custom Collector for the Debug Toolbar:
https://codeigniter4.github.io/CodeIgniter4/testing/debugging.html?#creating-custom-collectors

However, the Toolbar service takes a static $viewsPath from app/Config/Toolbar.php and then toolbar.tpl.php uses this to render a view template for each Collector:
https://github.com/codeigniter4/CodeIgniter4/blob/develop/system/Debug/Toolbar/Views/toolbar.tpl.php#L139

Therein lies the conundrum: $viewsPath will either be the default SYSTEMPATH . 'Debug/Toolbar/Views/' (where developers should not inject their own _packagename.tpl) or some other path which will lack the view templates for core Collectors.

The Guide states "display() should return a string of HTML" but it actually needs to return an array: https://github.com/codeigniter4/CodeIgniter4/blob/develop/system/Debug/Toolbar/Collectors/BaseCollector.php#L237)

My guess is that the User Guide is reflecting a step in the direction of making it easier to create custom Collectors (by directly return HTML from display()), but that change hasn't been implemented in the Toolbar class yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant