PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, December 28, 2021

[FIXED] How can I disable yii-debug-toolbar on a specific view?

 December 28, 2021     debugging, php, yii, yii-extensions     No comments   

Issue

How can I disable yii-debug-toolbar on a specific view especially on partial rendered views?

Is this possible?

p.s. Yii-debug-toolbar does unfortunately not exist as a tag below.


Solution

Put this in your layout or view file:

if (class_exists('yii\debug\Module')) {
    $this->off(\yii\web\View::EVENT_END_BODY, [\yii\debug\Module::getInstance(), 'renderToolbar']);
}

This removes the callback that renders the toolbar from the event that runs at the end of the layout, where you have $this->endBody().



Answered By - spikyjt
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing