1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

About YAML and how to edit many way

Discussion in 'Development' started by Hoyee, Jun 13, 2020.

  1. Hoyee

    Hoyee Baby Zombie

    Messages:
    126
    How can I edit YAML

    Code:
    $this->con[CON];
    1. clear all of contents in YAML

    2. clear a part of what I want in YAML

    3. restore YAML contents

    4. remove YAML

    and lastly what is difference of $this->con[CON] and $this->con[CON][]
     
  2. Emirhan Akpınar

    Emirhan Akpınar Slime

    Messages:
    90
    Before you must use Config.
    PHP:
    $config = new Config("yamlPath"Config::YAML);
    1-) Clear all contents of YAML.
    PHP:
    $config->setAll([]);
    2-) Clear a part from YAML:
    PHP:
    $config->remove("key'");
    3-) Config class already created for i/o process in YAML / JSON etc. files.
    4-) Remove YAML (or any file in PHP)
    PHP:
    unlink("filepath");
    Don't forget save the Config when you use setting functions.
    PHP:
    $config->save();
    Save function apply the changes on Config in YAML.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.