Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6320947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:03:54+00:00 2026-05-24T16:03:54+00:00

I am wanting to build a basic theme with a default config file and

  • 0

I am wanting to build a basic theme with a default config file and then I want to build sub themes with config files that are merged with the master theme. Should I use the Kohana::config class to manage this or would it be best to handle this manually by including the config array and merging it with the master config? So far I haven’t been able to get the config files to load at all because I’ve got them located within their own directory.

Basically What I’m trying to do is setup a structure like:

application
|--> classes
     |--> myclass
          |--> myclass.php  // default parent class. Loads the config
          |--> config.php   // array of default config settings
          |--> theme
               |--> blue
               |    |--> blue.php   // extends myclass.php
               |    |--> config.php // merges over the default config settings
               |--> red
               |    |--> red.php    // extends myclass.php
               |    |--> config.php // merges over the default config settings
               |--> green
                    |--> green.php  // extends myclass.php
                    |--> config.php // merges over the default config settings

So I can then call something like:

$theme = new Myclass_Theme_Red_Red();

and have the theme loaded with the default configs from Myclass_Myclass and then have the red theme merged over the defaults. I hope this make sense.

So what is the best way of handling config settings within this sort of structure – or is there a better approach entirely? I don’t want to move all the config files into application/config as I would prefer them to be kept with the individual themes.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T16:03:55+00:00Added an answer on May 24, 2026 at 4:03 pm

    I’d put the config files into a config directory which is a sibling of the classes directory.

    So your new directory structure would be:

    application  
     |- classes  
     |- config (your files go in here)
     |-- theme (and can be in their own namespaced directory)
     |--- green  
     |--- red  
     |--- blue
    

    This is where your configuration files should always go. If you need to do something which Kohana doesn’t support then you can add a custom config reader in your (modules) bootstrap [1].

    Kohana::$config->attach(new Kohana_Config_File);
    

    [1] Attaching a new config reader in Kohana

    A common example would be to load config files from a sub-directory which can be achieved with:

    Kohana::$config->attach(new Kohana_Config_File);
    Kohana::$config->attach(new Kohana_Config_File('config'.DIRECTORY_SEPARATOR.Kohana::$environment));
    

    This allows me to use different config settings per environment with Kohana.

    If you desperately want to keep your config files with the classes you might want to make each theme a separate module.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to build a windows service that will use a remote encoding service
I am wanting to build a Kynetx app that does a datasource query once
I'm new to coding in general, and I'm wanting to build a website that
I would like to build a generic class that I can use to implement
Hello I am looking to build a basic API and application/apps system on my
My question is : in PHP are interfaces really useful for developers that build
I'm wanting to build an app with 2 core data handlers for one iphone
I'm trying to build a project in JavaScript that utilizes HTML5's canvas tag. However,
I'm wanting to add a search box onto my website - which is built
Is there a built in method for waiting for a file to be created

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.