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

Listen(er) and store - Option ID

Discussion in 'XenForo Development Discussions' started by 3v1LD34D, Aug 6, 2015.

  1. 3v1LD34D

    3v1LD34D Member


    I've been reading what feels like a hundred threads on storing global values, all of them pre-defined in php files, and making them available elsewhere
    in xenforo but what i really want is to be able to listen for say option id's and store their values for use elsewhere.

    Im not looking for people to do the work for me, just want someones opinion where to start rather than picking up bad habbits.

    I have created an addon with a listener, created a folder structure that stores a value on a tutorial on this site but thats as far as i've got.
    A few tutorials here and there, but very much a beginner.

    Any advice would be awesome,
  2. batpool52!

    batpool52! Well-Known Member

    Get ACP option value
    $hi XenForo_Application::getOptions()->get('option_id');
    What do you mean by that? Store where? A different table? Inside another ACP option?
  3. 3v1LD34D

    3v1LD34D Member

    Sorry for not being more specific.

    I've been trying to create a few widgets which display raw html in a block, i have taken apart some examples and can do that now fairly easily.
    Control panel side, the admin can set a value for an option id and thats all it does... sets a value against that option id.
    Now, what i have been looking for is to call that value in that html... Sorry for being an inquisitive novice.


    Thanks for your suggestion above.
  4. batpool52!

    batpool52! Well-Known Member

    By "in html" do you mean inside template? If so you can do that using
    that would return the option value in html.

Share This Page