Load codeigniter settings into external file

Asked

Viewed 185 times

0

Does anyone know how I load all the codeigniter settings into any external file, giving a require?

For example: A . css file that takes information from the database!

Someone knows how to include, or what file to include so that it loads all the database configuration that is already in the application/config/database.php ??

Thanks in advance...

2 answers

1

Your question is not very clear, especially the case with .css. From what I understand, you want to get the contents of the CI files and include them in the database or in another PHP file.

Well, take a look at the helper File of the IC and in its functions for reading and writing files from site folders.

The nice thing about using this helper is that you can overwrite, for example, the file config.php or database.phpwith custom settings.

0

Carregue as informações com o config->item:
    $this->config->item('nome_da_config');
    
    EX Carregando CSS com URL Completa:

<link rel="stylesheet" href="<?= $this->config->item('base_url'); ?>css/arquivo.css" type="text/css">

Browser other questions tagged

You are not signed in. Login or sign up in order to post.