Login +

Documentation

SLS_FrontModel::toXML

Since SillySmart 1.0.8

Description

Format XML for the current recordset
public SLS_XMLToolbox toXML (SLS_XMLToolbox $xml, [ array $options ] , [ mixed $fks ] , [ string $nodeName ] , [ array $properties ] );

Parameters

  • SLS_XMLToolbox $xml
    current controller's XML
  • array $options
    transformations on some columns - delimited by ":". each function can be methods of SLS' classes or php standard function
     // Complete example
     $xml = $news->toXML($xml, array( "news_excerpt" ||t||=> array("php:strip_tags", "SLS_String:trimStringToLength:100"),
    ||t||||t||||t||||t||||t||||t||||t||||t||||t||"news_date" ||t||=> array("SLS_Date:getDate:FULL_LITTERAL_TIME", "php:ucwords"),
    ||t||||t||||t||||t||||t||||t||||t||||t||||t||"news_photo" ||t||=> "SLS_String:getUrlFileImg:_0",
    ||t||||t||||t||||t||||t||||t||||t||||t||||t||"news_pdf" ||t||||t||=> "SLS_String:getUrlFile",
    ||t||||t||||t||||t||||t||||t||||t||||t||||t||"news_title" ||t||=> "php:trim")
    ||t||||t||||t||||t||||t||||t||, true, "news");
     
  • mixed $fks
    (bool: if true all fks, if false only current Model) - array fks you want to extract params
  • string $nodeName
    the root node of your model, by default it's your classname in lowercase
  • array $properties
    all columns/values of your choice if you don't want to take it from getParams() function of the current instance

Return

SLS_XMLToolbox $xml
current controller's XML updated
No exemples.

Comments

No comment on this function, be the first !

Add your comment

You must login/register to post a reply.