mirror of
https://github.com/php/doc-tr.git
synced 2026-03-24 07:12:18 +01:00
176 lines
4.6 KiB
XML
176 lines
4.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<!-- EN-Revision: 770c6facae667218f69c8ea2715ea20f6fab32f3 Maintainer: nilgun Status: ready -->
|
||
<refentry xml:id="simplexmlelement.addattribute" xmlns="http://docbook.org/ns/docbook">
|
||
<refnamediv>
|
||
<refname>SimpleXMLElement::addAttribute</refname>
|
||
<refpurpose>XML elemanına bir öznitelik ekler</refpurpose>
|
||
</refnamediv>
|
||
<refsect1 role="description">
|
||
&reftitle.description;
|
||
<methodsynopsis role="SimpleXMLElement">
|
||
<modifier>public</modifier> <type>void</type><methodname>SimpleXMLElement::addAttribute</methodname>
|
||
<methodparam><type>string</type><parameter>isim</parameter></methodparam>
|
||
<methodparam><type>string</type><parameter>değer</parameter></methodparam>
|
||
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>isimalanı</parameter><initializer>&null;</initializer></methodparam>
|
||
</methodsynopsis>
|
||
<para>
|
||
<classname>SimpleXMLElement</classname> düğümüne bir öznitelik ekler.
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="parameters">
|
||
&reftitle.parameters;
|
||
<para>
|
||
<variablelist>
|
||
<varlistentry>
|
||
<term><parameter>isim</parameter></term>
|
||
<listitem>
|
||
<para>
|
||
Eklenecek özniteliğin ismi.
|
||
</para>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry>
|
||
<term><parameter>değer</parameter></term>
|
||
<listitem>
|
||
<para>
|
||
Özniteliğin değeri.
|
||
</para>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry>
|
||
<term><parameter>isimalanı</parameter></term>
|
||
<listitem>
|
||
<para>
|
||
Belirtilmişse, özniteliğin ait olduğu isim alanı.
|
||
</para>
|
||
</listitem>
|
||
</varlistentry>
|
||
</variablelist>
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="returnvalues">
|
||
&reftitle.returnvalues;
|
||
<para>
|
||
&return.void;
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="examples">
|
||
&reftitle.examples;
|
||
<para>
|
||
<note>
|
||
<para>
|
||
Aşağıdaki örnekler, <link linkend="simplexml.examples-basic">temel
|
||
kullanım</link> kılavuzunun ilk örneğinde bulunan XML dizesine atıfta
|
||
bulunan <literal>example.php</literal> betiğini içerebilir.
|
||
</para>
|
||
</note>
|
||
<example>
|
||
<title>- Bir <classname>SimpleXMLElement</classname> nesnesine
|
||
öznitelikler ve çocuk elemanlar eklemek</title>
|
||
<programlisting role="php">
|
||
<![CDATA[
|
||
<?php
|
||
|
||
include 'example.php';
|
||
|
||
$sxe = new SimpleXMLElement($xmlstr);
|
||
$sxe->addAttribute('type', 'documentary');
|
||
|
||
$movie = $sxe->addChild('movie');
|
||
$movie->addChild('title', 'PHP2: More Parser Stories');
|
||
$movie->addChild('plot', 'This is all about the people who make it work.');
|
||
|
||
$characters = $movie->addChild('characters');
|
||
$character = $characters->addChild('character');
|
||
$character->addChild('name', 'Mr. Parser');
|
||
$character->addChild('actor', 'John Doe');
|
||
|
||
$rating = $movie->addChild('rating', '5');
|
||
$rating->addAttribute('type', 'stars');
|
||
|
||
echo $sxe->asXML();
|
||
|
||
?>
|
||
]]>
|
||
</programlisting>
|
||
&example.outputs.similar;
|
||
<screen>
|
||
<![CDATA[
|
||
<?xml version="1.0" standalone="yes"?>
|
||
<movies type="documentary">
|
||
<movie>
|
||
<title>PHP: Behind the Parser</title>
|
||
<characters>
|
||
<character>
|
||
<name>Ms. Coder</name>
|
||
<actor>Onlivia Actora</actor>
|
||
</character>
|
||
<character>
|
||
<name>Mr. Coder</name>
|
||
<actor>El ActÓr</actor>
|
||
</character>
|
||
</characters>
|
||
<plot>
|
||
So, this language. It's like, a programming language. Or is it a
|
||
scripting language? All is revealed in this thrilling horror spoof
|
||
of a documentary.
|
||
</plot>
|
||
<great-lines>
|
||
<line>PHP solves all my web problems</line>
|
||
</great-lines>
|
||
<rating type="thumbs">7</rating>
|
||
<rating type="stars">5</rating>
|
||
</movie>
|
||
<movie>
|
||
<title>PHP2: More Parser Stories</title>
|
||
<plot>This is all about the people who make it work.</plot>
|
||
<characters>
|
||
<character>
|
||
<name>Mr. Parser</name>
|
||
<actor>John Doe</actor>
|
||
</character>
|
||
</characters>
|
||
<rating type="stars">5</rating>
|
||
</movie>
|
||
</movies>
|
||
]]>
|
||
</screen>
|
||
</example>
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="seealso">
|
||
&reftitle.seealso;
|
||
<para>
|
||
<simplelist>
|
||
<member><methodname>SimpleXMLElement::addChild</methodname></member>
|
||
<member><xref linkend="simplexml.examples-basic"/></member>
|
||
</simplelist>
|
||
</para>
|
||
</refsect1>
|
||
</refentry>
|
||
|
||
<!-- 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
|
||
-->
|