Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
config save
  • hi Harro
    i can't save config in file.
    i use this code :
    read :
    \config::get('website');
    save :
    \config::save('website.title', \input::post('title'));
    but nothing save!!!
    i create table config by this doc http://fuelphp.com/docs/classes/config.html
    and document not complete for use.
    how can i save my config?


    please change forums search, search result is very bad and i can't find anything
    thanks.
  • HarroHarro
    Accepted Answer
    I assume it is saved, but not where you think it was saved.

    If you don't specify the backend, Config will default to php config files. If you want to save in the db, you have to tell the config class that: Also, you don't save a value, you save a loaded config.

    So:

    // save the input value to the config
    \Config::set('website.title', \Input::post('title'));

    // write the website config to the db with the key 'website'
    \config::save('website.db', 'website' );
  • HarroHarro
    Accepted Answer
    As for the search, this forum software is what it is I'm afraid.

    Use Google: "look for this site:fuelphp.com", the site keyword limits the search to this website.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion