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

Calling custom options?

Discussion in 'XenForo Development Discussions' started by RickM, Oct 6, 2010.

  1. RickM

    RickM Well-Known Member

    Anyone worked out how to use custom created options for an addon inside your main addon class yet?

    bit stuck!

    I've worked out that standard options for XenForo_Application are called as follows, but cant figure out custom ones:

    $options XenForo_Application::get('options');
    EDIT: Scrap that - they are stored in the default array! Man I need to sleep! :D

    Edit2: Hmm...it wont let me use the options in a custom addon :/ I just get this:

  2. RickM

    RickM Well-Known Member

    Right. Ignore me - got it sorted.

    For anyone looking to use custom (or standard) options in their addons, you call them like so:

    $rating_forum XenForo_Application::get('options')->ratingforum_id;
    Where 'ratingforum_id' is the unique ID you assigned the option when creating it.
  3. Mythotical

    Mythotical Well-Known Member

    Sheesh, didn't even give me time to reply before you figured it out. LOL :p
  4. RickM

    RickM Well-Known Member


    I'll confess....had to look at the code of a couple of existing mods before I figured it out! :oops:
  5. Lawrence

    Lawrence Well-Known Member

    I'll be covering that is my addon walk-through I'm currently writing up.
    Jeremy likes this.

Share This Page