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

How to edit that is inside datafolder

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

  1. Hoyee

    Hoyee Baby Zombie

    Messages:
    126
    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,402
    GitHub:
    HimbeersaftLP
    PHP:
    $this->db["blue"] = "new player name";

    // And this code saves it to disk:
    $this->database->setAll($this->db);
    $this->database->save();
     
  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.