How to edit that is inside datafolder

Discussion in 'Development' started by Hoyee, Mar 12, 2020.

  1. Hoyee

    Hoyee Slime

    Messages:
    90
    I made a DataFolder with

    @mkdir ($this->getDataFolder());
    $this->database = new Config ($this->getDataFolder()."data.yml",Config::YAML,[
    "blue" => "player"
    ]);
    $this->db = $this->database->getAll();

    What code should I use to edit "player" to playername?
     
  2. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,362
    GitHub:
    HimbeersaftLP
    PHP:
    $this->db["blue"] = "new player name";

    // And this code saves it to disk:
    $this->database->setAll($this->db);
    $this->database->save();
     

Share This Page

  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.