Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthorOmeZ
     
    Hi, I just started use Akelos and I have a lot of questions about similarity between this and ROR.
    At the moment I have difficult in inheritance of controllers in router. Can I use something like "admin/controller/subcontroller" structure in Akelos applications? and how can I setup this in routes config?

    To be most clear I explain my difficult more exact:
    I need to separate my controllers by directries structute and also keep my controller inheritance like that is made in ROR. For example in ROR I can generate "admin/controllername", so as result I'll get ability to call this controller like "mysite/admin/controller/action" and I have sufficiant directoty structure as result "/admin/controllername.rb". When I do the same in Akelos I have admin_controllername_controller.php in controllers dir and no ability to call this propertly. So, can you give me solution of this problem or ways to fix it off?
    • CommentAuthorOmeZ
     
    I analyzed the code and found that in AkRouter::toParams() you implement actions to divide gotten url string according to router Maps. So maybe problem in that? Maybe allow this script to analyze directory structure and find needed controller file or something like this? But actually I don't like this method of coding because it's not very clear style. Anyway you check controller existance in next steps of call chain...
    •  
      CommentAuthorbermi
     

    Hi OmeZ and welcome to the Akelos forum.

    You're looking for Rails modules in Akelos. I just wrote a piece of documentation explaining how the Akelos PHP Framework modules work.

    I think that is what you were looking for.

    Hope you find it useful.

    • CommentAuthorOmeZ
     
    thanx for help!
    yes, it useful information, but besides:
    1) what about /admin/politics/groupolitics/.../lalalacontroller etc?
    2) maybe it's possible to make automated system of this? 'cause it's not very clear for trace

    Maybe I have solution for this:
    what about setup parameter in routes 'module'=>'admin' as array like 'module'=>array('admin','politics'...)?
    So, the same way will be used for var $module=array('admin','politics') instead var $module='admin' in my controllers, models etc. So I can make any controller inheritance if needed
    • CommentAuthormilind
     
    Hi, I have just started using the Akelos framework using booklink example and got it to work. Just came across this to organize the controller into modules and tryied as per the info provided by bermi for the same booklink example.

    Here is the link which am trying.
    http://booklink.local.gatesix.com/?ak=/admin/author/listing/

    and this is the error am getting.

    Fatal Error: Could not find the file /app/controllers/author_controller.php for the controller AuthorController.

    Seems it is not picking the admin folder. I map the request in router. Shifted my controller in admin folder and added the prefix Amin before that. Whats wrong!
    • CommentAuthorOmeZ
     
    NOTICE: problem was mystical, I found problem in my brain =) (c) Alice
    I've got this problem too, but very fast solve this. Bug was in echo error message, look my next post
    • CommentAuthorOmeZ
     
    to: # milind
    use fresh 0.8 version of framework, module feature was added only there
    in attachment I store class AkRequest with small fix in error message, 'cause it doesn't show $module_path in this

    Question for Bermi: is this correctly apply plural forms of controller?
    •  
      CommentAuthorbermi
     
    • CommentAuthorOmeZ
     
    ok, sorry, it was stupid question, I mean in generator automatically.
    I executed generate controller Admin::User, and this created singular form controller, but it's not very clear I suppose. Maybe it's logical to automatically change this form from singular to plural directly in generator?
    • CommentAuthormilind
     
    Thanks OmeZ for help! Its working now. But it seems that this does not generate the respective views using generator.