viewlogger Log the name of views in the html

Have you ever tried to open a project after a while and think: "I know that this html lies in some view, maybe some controller view... maybe a sub-view or some widget view...."

Now this problem is solved! Just install this widget, set a new debug constant (LOG_VIEW_NAMES) and you will get developer-friendly comments in your html like:

<!-- BEGIN C:\www\mySite\protected\components\views\hotelList\list.php -->
/* all view html */

<!-- END C:\www\mySite\protected\components\views\hotelList\list.php -->

Usage ΒΆ

Unzip the content in an included folder (components, for example).

Make all your controller to extend the loggin controller:

class MyController extends ZLoggingController

If you use Gii generated application, you already have a masterclass for controller. Just edit the first line of the file protected/components/Controller.php:

class Controller extends ZLoggingController

And all views and subviews will be logged.

For log widgets, edit widgets in order to extend the class logging widget:

class MyWidget extends ZLoggingWidget

The log will not be displayed as default. If you want to log, add this line in index.php:

defined('LOG_VIEW_NAMES') or define('LOG_VIEW_NAMES',true);

10 0
11 followers
623 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Logging
Tags: log, view, widget
Developed by: zaccaria
Created on: Apr 13, 2011
Last updated: 12 years ago

Downloads

show all

Related Extensions