PHP Doku:: Sets the object in which to resolve callback functions - function.xslt-set-object.html

Verlauf / Chronik / History: (8) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzXML-ManipulationXSLTXSLT Funktionenxslt_set_object

Ein Service von Reinhard Neidl - Webprogrammierung.

XSLT Funktionen

<<xslt_set_log

xslt_set_sax_handler>>

xslt_set_object

(PHP 4 >= 4.3.0)

xslt_set_objectSets the object in which to resolve callback functions

Beschreibung

bool xslt_set_object ( resource $processor , object &$obj )

This function allows to use the processor inside an object and to resolve all callback functions in it.

The callback functions can be declared with xslt_set_sax_handlers(), xslt_set_scheme_handlers() or xslt_set_error_handler() and are assumed to be methods of object.

Parameter-Liste

processor

The XSLT processor link identifier, created with xslt_create().

obj

An object.

Rückgabewerte

Gibt bei Erfolg TRUE zurück. Im Fehlerfall wird FALSE zurückgegeben.

Beispiele

Beispiel #1 Using your own error handler as a method

<?php

class my_xslt_processor {

    var 
$_xh// our XSLT processor

    
function my_xslt_processor()
    {
        
$this->_xh xslt_create();

        
// Make $this object the callback resolver
        
xslt_set_object($this->_xh$this);

        
// Let's handle the errors
        
xslt_set_error_handler($this->_xh"my_xslt_error_handler");
    }

    function 
my_xslt_error_handler($handler$errno$level$info)
    {
        
// for now, let's just see the arguments
        
var_dump(func_get_args());
    }
}

?>

Keine BenutzerBeiträge.
- Beiträge aktualisieren...



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)