Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[New API] Lists in config?

Comments in 'Plugin Development' started by Adaasi, Sep 3, 2014.

  1. Adaasi
    Offline

    Adaasi Active Member

    Joined:
    Aug 14, 2014
    Posts:
    80
    How can I read config lists like this?
    Code:
    example:
    - ex1
    - ex2
    - ex3
  2. ZenCloud
    Offline

    ZenCloud Active Member

    Joined:
    May 14, 2014
    Posts:
    61
    Minecraft User:
    ZenCloud
    What do you mean read?
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    It is not a list config. It is just a YAML. You just create a config object on that file and $config->get("example") to get a plain array equivalent to array("ex1", "ex2", "ex3"). But if you only want to save an array, you can consider creating config with Config::ENUM instead of Config::YAML, and
    $config->exists("ex1");
    $config->set("ex2");
    $config->remove("ex3");
    64FF00 likes this.
  4. Adaasi
    Offline

    Adaasi Active Member

    Joined:
    Aug 14, 2014
    Posts:
    80

Share This Page

Advertisement