1
0
mirror of https://github.com/php/doc-tr.git synced 2026-03-24 07:12:18 +01:00
Files
archived-doc-tr/reference/outcontrol/examples.xml
2024-01-15 16:20:57 +03:00

113 lines
3.3 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: e0b70f68d03701ce531be0025af19cdcfe333782 Maintainer: nilgun Status: ready -->
<appendix xml:id="outcontrol.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.examples;
<section xml:id="outcontrol.examples.basic">
<title>Basic usage</title>
<para>
<example>
<title>- Çıktı Denetimi örneği</title>
<programlisting role="php">
<![CDATA[
<?php
ob_start();
echo "Hello\n";
setcookie("cookiename", "cookiedata");
ob_end_flush();
?>
]]>
</programlisting>
</example>
</para>
<para>
Yukarıdaki örnekte, <function>ob_end_flush</function> işlevi çağrılana kadar
<function>echo</function> çıktısı çıktı tamponunda saklanır. Bu süre
zarfında, <function>setcookie</function> çağrısı çerezi bir hataya yol
açmadan başarıyla saklar. (Normalde, tarayıcıya veri gönderildikten sonra
başlıkları gönderemezsiniz.)
</para>
</section>
<section xml:id="outcontrol.examples.rewrite">
<title>- Çıktının yeniden yazılması</title>
<para>
PHP 7.1.0'dan beri, <function>output_add_rewrite_var</function> ve
<function>output_reset_rewrite_vars</function> adanmış çıktı tamponunu
kullanır. Yani, <link linkend="ini.session.use-trans-sid">trans sid</link>
çıktı tamponunu kullanmaz.
</para>
<para>
<example>
<title>- Çıktının yeniden yazılması örneği</title>
<programlisting role="php">
<![CDATA[
<?php
// Bu kod PHP 7.1.0, 7.0.10, 5.6.25 ve üstü ile çalışır.
// HTTP_HOST öntanımlı hedef konaktır. Örnek kodun çalışması için elle atanır
$_SERVER['HTTP_HOST'] = 'php.net';
// Sadece form yeniden yazılır. a=href ekle.
// Etiketler etk_adı=url_özntlk biçeminde belirtilebilir,
// örn. img=src,iframe=src
// Atamalar arasında boşluk bulunmamalıdır.
// Form etiketi özel bir etiket olup gizli (hidden) girdi ekler.
ini_set('url_rewriter.tags','a=href,form=');
var_dump(ini_get('url_rewriter.tags'));
// Bu, URL ve form'a eklenir
output_add_rewrite_var('test', 'value');
?>
<a href="//php.net/index.php?bug=1234">bug1234</a>
<form action="https://php.net/?bug=1234&edit=1" method="post">
<input type="text" name="title" />
</form>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
<a href="//php.net/?bug=1234&test=value">bug1234</a>
<form action="https://php.net/?bug=1234&edit=1" method="post"><input type="hidden" name="test" value="value" />
<input type="text" name="title" />
</form>
]]>
</screen>
</example>
</para>
<para>
PHP 7.1.0'dan beri, çıktı yeniden yazma işlevleri kendi INI yönergelerine
sahiptir: <link linkend="ini.url-rewriter.tags">url_rewriter.tags</link> ve
<link linkend="ini.url-rewriter.hosts">url_rewriter.hosts</link>.
</para>
</section>
</appendix>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->