Date: 11/12/00
- Next message: Derick Rethans: "Re: [PHP-DOC] cvs: phpdoc / global.ent /en/functions outcontrol.xml"
- Previous message: Derick Rethans: "[PHP-DOC] cvs: phpdoc /en/functions sem.xml /nl/functions sem.xml"
- Next in thread: Derick Rethans: "Re: [PHP-DOC] cvs: phpdoc / global.ent /en/functions outcontrol.xml"
- Reply: Derick Rethans: "Re: [PHP-DOC] cvs: phpdoc / global.ent /en/functions outcontrol.xml"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
kk Sun Nov 12 14:13:46 2000 EDT
Modified files:
/phpdoc global.ent
/phpdoc/en/functions outcontrol.xml
Log:
Added stuff on output buffering callbacks.
Index: phpdoc/global.ent
diff -u phpdoc/global.ent:1.57 phpdoc/global.ent:1.58
--- phpdoc/global.ent:1.57 Fri Oct 27 07:06:07 2000
+++ phpdoc/global.ent Sun Nov 12 14:13:45 2000
@@ -1,6 +1,6 @@
<!-- -*- SGML -*-
- $Id: global.ent,v 1.57 2000/10/27 14:06:07 eschmid Exp $
+ $Id: global.ent,v 1.58 2000/11/12 22:13:45 kk Exp $
Contains global "macros" for all the SGML documents.
@@ -95,6 +95,7 @@
<!ENTITY url.redhat.ccvs "http://www.redhat.com/products/ccvs">
<!ENTITY url.redhat.support "http://www.redhat.com/products/ccvs/support/CCVS3.3docs/ProgPHP.html">
<!ENTITY url.rfc 'http://www.faqs.org/rfcs/'>
+<!ENTITY url.sablotron "http://www.gingerall.com/">
<!ENTITY url.sleepycat "http://www.sleepycat.com/">
<!ENTITY url.solid "http://www.solidtech.com/">
<!ENTITY url.strnatcmp "http://www.linuxcare.com.au/projects/natsort/">
@@ -111,6 +112,7 @@
<!ENTITY url.wddx "http://www.wddx.org/">
<!ENTITY url.xemacs "http://www.xemacs.org/">
<!ENTITY url.xml "http://www.w3.org/XML/">
+<!ENTITY url.xslt "http://www.w3.org/TR/xslt">
<!ENTITY url.yaz "http://www.indexdata.dk/yaz/">
<!ENTITY url.yaz-phpyaz "http://www.indexdata.dk/phpyaz/">
<!ENTITY url.zend "http://www.zend.com/">
Index: phpdoc/en/functions/outcontrol.xml
diff -u phpdoc/en/functions/outcontrol.xml:1.8 phpdoc/en/functions/outcontrol.xml:1.9
--- phpdoc/en/functions/outcontrol.xml:1.8 Thu Nov 9 03:24:08 2000
+++ phpdoc/en/functions/outcontrol.xml Sun Nov 12 14:13:46 2000
@@ -94,7 +94,11 @@
<funcsynopsis>
<funcprototype>
<funcdef>void <function>ob_start</function></funcdef>
- <void/>
+ <paramdef>string
+ <parameter>
+ <optional>output_callback</optional>
+ </parameter>
+ </paramdef>
</funcprototype>
</funcsynopsis>
<para>
@@ -110,6 +114,48 @@
<function>ob_end_clean</function> will silently discard the
buffer contents.
</para>
+ <para>
+ An optional output_callback function may be specified. This
+ function takes a string as a parameter and returns a string.
+ The function will be called at <function>ob_end_flush</function>
+ time and will receive the contents of the output buffer as its
+ parameter. It must return a new output buffer as a result,
+ which is what will be printed.
+ </para>
+ <para>
+ Output buffers are stackable, that is, you may call
+ <function>ob_start</function> while another
+ <function>ob_start</function> is active. Just make
+ sure that you call <function>ob_end_flush()</function>
+ the appropriate number of times. If multiple output callback
+ functions are active, output is being filtered sequentially
+ through each of them in nesting order.
+ </para>
+ <example>
+ <title>Callback function example</title>
+ <programlisting role="php">
+<?php
+function c($str) {
+ // Druu Chunusun mut dum Kuntrubuß...
+ return nl2br(ereg_replace("[aeiou]", "u", $str));
+}
+
+function d($str) {
+ return strip_tags($str);
+}
+?>
+
+<?php ob_start("c"); ?>
+Drei Chinesen mit dem Kontrabaß...
+<?php ob_start("d"); ?>
+<h1>..saßen auf der Straße und erzählten sich was...</h1>
+<?php ob_end_flush(); ?>
+... da kam die Polizei, ja was ist denn das?
+<?php ob_end_flush(); ?>
+
+?>
+ </programlisting>
+ </example>
<para>
See also <function>ob_get_contents</function>,
<function>ob_end_flush</function>,
- Next message: Derick Rethans: "Re: [PHP-DOC] cvs: phpdoc / global.ent /en/functions outcontrol.xml"
- Previous message: Derick Rethans: "[PHP-DOC] cvs: phpdoc /en/functions sem.xml /nl/functions sem.xml"
- Next in thread: Derick Rethans: "Re: [PHP-DOC] cvs: phpdoc / global.ent /en/functions outcontrol.xml"
- Reply: Derick Rethans: "Re: [PHP-DOC] cvs: phpdoc / global.ent /en/functions outcontrol.xml"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

