symfony API

sfYaml Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.1 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.1 version. Switch to:
This version of symfony is not maintained anymore.
If some of your projects still use this version, consider upgrading as soon as possible.

sfYaml class.

Method Summary

  • string dump($array, $inline)
    Dump YAML from PHP array statically
  • echoln()
    Wraps echo to automatically provide a newline.
  • array load($input)
    Load YAML into a PHP array statically

Method Details

  • (string) dump ($array, $inline) Browse code

    $array PHP array
    $inline The level where you switch to inline YAML

    Dump YAML from PHP array statically


    The dump method, when supplied with an array, will do its best
    to convert the array into friendly YAML.

  • echoln () Browse code

    Wraps echo to automatically provide a newline.

  • (array) load ($input) Browse code

    $input Path of YAML file or string containing YAML

    Load YAML into a PHP array statically


    The load method, when supplied with a YAML stream (string or file),
    will do its best to convert YAML in a file into a PHP array.

    Usage:

    $array = sfYaml::load('config.yml');
    print_r($array);