Свежайшие Пирожки от CakePHP по-русски

Полнейшее руководство CakePHP 1.2 на русском языке, горячие новости и полезные статьи

serialize

The serialize method takes an array and creates an XML string of the data. This is commonly used for serializing model data.

Простой текст
  1. <?php
  2. echo $xml->serialize($data);
  3. // format will be similar to:
  4. // <model_name id="1" field_name="content" />
  5. ?>

The serialize method acts as a shortcut to instantiating the XML built-in class and using the toString method of that. If you need more control over serialization, you may wish to invoke the XML class directly.