Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are probably a lot of ways to do this... but one that I can think of off the top of my head is to put something in the index.php file where the preloaded custom config values are established that does something like this...</p> <pre><code>/* * ------------------------------------------------------------------- * CUSTOM CONFIG VALUES * ------------------------------------------------------------------- * * The $assign_to_config array below will be passed dynamically to the * config class when initialized. This allows you to set custom config * items or override any default config values found in the config.php file. * This can be handy as it permits you to share one application between * multiple front controller files, with each file containing different * config values. * * Un-comment the $assign_to_config array below to use this feature * */ $region_prefix_var = explode('.', $_SERVER['HTTP_HOST']); $assign_to_config['region_prefix'] = $region_prefix_var[0]; </code></pre> <p>and then in your config.php file</p> <pre><code>global $region_prefix_var; $config['base_url'] = $region_prefix_var[0].".site.com/"; </code></pre> <p>...or you could just override the base_url in the index.php file in the $assign_to_config array based on the $_SERVER['HTTP_HOST'] value. Then in any other controllers or whatever you can base things off of</p> <pre><code>$this-&gt;config-&gt;item('region_prefix'); </code></pre> <p>And then just point all of the subdomains at the same directory and localize within your app.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload