Jump to content

Using fuel (or another way of setting constants)


thomas
 Share

Recommended Posts

Hello,

a long time ago I learned in this forum that a nice way of making something accessible throughout my site is

    public function ready() {

        $company = wire('pages')->get(...);

        $this->fuel->set("company", $company);

    }

in a module. I use this so I only need to declare $company once and then use it in all of my templates.

Now my question is twofold:

- is this a good way of doing this? 

- I often use little scripts outside the template folder which bootstrap PW and do little things, mostly via Ajax or sometimes in the terminal. Now how can I make $company available to those? I tried a lot of combinations of wire('company'), $this->fuel->get and so on but no success.

Who can help?

Thanks,

thomas 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...