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 8204313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:51:35+00:00 2026-06-07T07:51:35+00:00

We have written a pretty complex web application which has following requirements: It has

  • 0

We have written a pretty complex web application which has following requirements:

  • It has an API. Different versions of API may behave differently. We have to support old version of APIs for sometime.
  • It has a web client. The web clients uses AJAX to get various data. Say 99% The XHR requests are same as API requests. So, the source code for supporting these XHR requests should be shared for APIs. But same are different for example the login api should respond with cookies in case of web and with JSON in case of api.
  • There are multiple types of clients such as iPhone, iPad, Android Phone, tablets, browser extensions etc. The behavior may vary based on the platform which is making a request.

One way to organize this stuff I was thinking of is extending the Kohana HMVC cascading style to a level more. For example:

src/
htdocs/
v1/
    device_group_phone/
        device_iphone/
            controllers/
            views/
        device_android/
            controllers/
            views/
        device_default/
            conrollers/
            views/
    device_group_tablet/
        device_ipad/
            controllers/
            views/
        device_default/
            conrollers/
            views/
    device_group_default/
        controllers/
        views/
        models/        
v2/
    ...
    ...
    ...
modules/
system/

The way a request should be served is:

 - Go to proper version.
 - if there is a controller/view device(x),
     then load it.
   else, if there exists a controller/view for device_group(x)/device_default, 
     then load it.
   else if there exists a controller/view for device_group_default
     then load it.
  • First question, is there better way than this to organize this code?
  • Second question, if not, how to do it in Kohana?
  • 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-06-07T07:51:38+00:00Added an answer on June 7, 2026 at 7:51 am

    Why dont use existing Kohana Cascade Filesystem? Your groups are modules, just add modules you need (via Kohana::modules()) based on Request properties. So, if you need to handle android device, module list would be like this:

    • v1/device_group_phone/device_android
    • v2/device_group_phone/device_android
    • v1/device_group_phone/device_default
    • v2/device_group_phone/device_default
    • v1/device_group_default
    • v2/device_group_default
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a fairly complex content management system I've written in PHP, which has
I have written a code and i'm pretty much stuck. In the following code,
I have written a PHP application which requires storage of millions of integers between
I have written a simple WCF web service which is configured programmaticaly. It exposes
I have written a simple Android application with a view which overrides onTouchEvent(). I
I have an application that I have designed and this app has a pretty
I have a method which can be written pretty neatly through method chaining: return
I have written something like this pretty easily in C# ( string GetUrl(new {
I've written an entire app pretty successfully in Django but I have this nagging
I have written the following constraint for a column I've called 'grade': CONSTRAINT gradeRule

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.