Login +

Documentation

SLS_FrontModel::pdoToXML

Since SillySmart 1.0.8

Description

Format XML for a given recordsets collection
public SLS_XMLToolbox pdoToXML (SLS_XMLToolbox $xml, array $recordsets, [ array $options ] , [ string $nodeName ] );

Parameters

  • SLS_XMLToolbox $xml
    current controller's XML
  • array $recordsets
    array of PDO recordsets
  • array $options
    transformations on some columns - delimited by ":". each function can be methods of SLS' classes or php standard function
     // Complete example
     $newss = $news->searchModels("news",array("user","article_category"));
     $xml = $news->pdoToXML($xml,$newss,array("news_excerpt" => array("php:strip_tags","SLS_String:trimStringToLength:100"),
    ||t||||t||||t||||t||||t||||t||||t||||t||||t||||t||||t||"news_date" => array("SLS_Date:getDate:FULL_LITTERAL_TIME","php:ucwords"),
    ||t||||t||||t||||t||||t||||t||||t||||t||||t||||t||||t||"news_photo" => "SLS_String:getUrlFileImg:_0",
    ||t||||t||||t||||t||||t||||t||||t||||t||||t||||t||||t||"news_pdf" => "SLS_String:getUrlFile",
    ||t||||t||||t||||t||||t||||t||||t||||t||||t||||t||||t||"news_title" => "php:trim")
    ||t||||t||||t||||t||||t||||t||, "all_news/news");
     
  • string $nodeName
    the root node of your model, by default it's your classname in lowercase

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.