What’s the diff between bootstart/app.php and config/app.php?

Permalink 1 user found helpful
I am needing to load certain assets for a block. I see that I need to add that asset to the app.php. However, there are many app.php’s

application/bootstrap/app.php
application/config/app.php
concrete/bootstrap/app.php
concrete/config/app.php


Presumably I want to only edit files under application, as this the where I override those in concrete.

But I do not understand the diff between bootstrap file and config files.

they are both empty, but bootstrap/app.php has a not of comments in it wit nite on how to tweak it, while config/app/php has one line only in it “return array();”

Under what circumstances is bootstrap/app.php called vs config/app.php? What would I put in one vs the other?

ntisithoj
 
ntisithoj replied on at Permalink Reply
ntisithoj
correction.. there is no app.php in concrete/bootstrap. it is in concrete/config/install
ntisithoj replied on at Permalink Reply
ntisithoj
found part of the answer here ->

https://www.concrete5.org/documentation/developers/5.7/environment/d...

Though still nto clear as to which one to edit
Korvin replied on at Permalink Best Answer Reply
Korvin
The concrete directory is only for core stuff, you shouldn't ever be editing anything within that directory. Therefore, we can ignore "concrete/bootstrap" and "concrete/config".
The bootstrap folder is meant for procedural code for generating a concrete5 app while the config folder is for php files that act as key value stores.

Now to clear up your question, the truth is it's fine to put in either bootstrap or config, but config is easier, cleaner, and overridable. If you'd like to implement it with the bootstrap file, an example is written in comments here: https://github.com/concrete5/concrete5-5.7.0/blob/develop/web/applic...

Otherwise you can look to `concrete/config/app.php` for the format assets are to be defined in:
<?php
// application/config/app.php
return array(
    'assets' => array(
        'my-block'                => array(
            array('javascript', 'js/my_blocks_js.js, array('minify' => false, 'combine' => false)),
            array('css', 'css/my_blocks_css.css', array('minify' => false)))));
ntisithoj replied on at Permalink Reply
ntisithoj
great answer! exactyl what I wanted to know :) thanks
janwidmer replied on at Permalink Reply
janwidmer
Hi Korvin,

How would you access such a config param?
When I try

<?php echo Config::get('app.xxx'); ?>


the return value is always empty..

Any idea?

BR Jan