Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    •  
      CommentAuthorthynctank
     
    I've recently expressed how impressed I am with Akelos to Bermi via email, and I continue to be impressed with how well many features of Rails have been ported over.

    However, one thing I feel is the most poorly documented - which is funny as I'd think it the simplest to document (copy and paste from Rails docs, right?) and one of the driving factors behind many developers' use of Akelos - is the usage of erb in Akelos view templates.

    I personally have become a bit frustrated when I tried to use some Rails idiom, such as a form_for block, and found it was not implemented in such a way as to use it identically to Rails. While this is no mean task, I've read statements somewhere in the site to the effect that it's possible to write entirely platform-portable views that will work in Rails or Akelos with no change necessary. Certainly many of the helpers available mirror their Rails brethren in usage, but there are many others which are either missing or implemented differently.

    I see form_for is defined, but I'm unclear on how to translate its usage in PHP (manually assigning a form builder object to a variable and calling helper methods of that object vs the Ruby-style block with pipe-delimited argument list)

    This may seem trivial but I'm of the mind that if I have the option of porting things back and forth with as little fuss as possible, why not write views that way as a matter of practicality and treat it as a kind of safety net for my app should I choose to jump ship on one platform?

    Other things in the erb of Akelos are that I can't print simple strings (<%= 'testing' %> or even variables (<%= test_var %>). I can only make calls to helpers, unless I'm mistaken.

    While sintags are great and I find myself using them over conventional PHP template code for many tasks, I'd love to be able to stick to erb if at all possible.

    I'll certainly contribute updates to helper code to bring it more in line with current Rails helpers as I wrap my head around this more. I'll also contribute to documentation.

    Any links to existing, extensive documentation, particularly aimed at existing Rails devs who are well-versed in PHP, would be greatly appreciated as well!
    •  
      CommentAuthorbermi
     

    Documentation for Sintags is really scarce, I personally refer people to unit test data files, which showcases sintags syntax converted PHP.

    I've read statements somewhere in the site to the effect that it's possible to write entirely platform-portable views that will work in Rails or Akelos with no change necessary

    This statement is false. Sintags is far from being a full Ruby interpreter. It would be nice to support as many idioms as possible to make it simpler for designers to manipulate erb and sintags views in the same way. Contributions on making this happen really welcomed.

    I see form_for is defined, but I'm unclear on how to translate its usage in PHP (manually assigning a form builder object to a variable and calling helper methods of that object vs the Ruby-style block with pipe-delimited argument list)

    This example is taken from the form_helper unit test.

    <? $f = $form_helper->form_for('person', $person, array('url' => array('action' => 'update'))); ?>
    
    <?=$f->text_field('person', 'name')?>
    
    <?=$f->password_field('person','password')?>
    

    This may seem trivial but I'm of the mind that if I have the option of porting things back and forth with as little fuss as possible, why not write views that way as a matter of practicality and treat it as a kind of safety net for my app should I choose to jump ship on one platform?

    Sintags is not erb. Making views 100% compatible might be possible but requires a lot of contributions from those interested in having such a feature.

    Other things in the erb of Akelos are that I can't print simple strings (<%= 'testing' %> or even variables (<%= test_var %>). I can only make calls to helpers, unless I'm mistaken.

    Thats right, you have a cleaner way to do it in Sintags (it was its original purpose)

    testing
    
    {test_var}
    

    See more details on basic Sintags

    I'll certainly contribute updates to helper code to bring it more in line with current Rails helpers as I wrap my head around this more. I'll also contribute to documentation.

    Great, we need contributions to help us improve Akelos for everyone.

    Any links to existing, extensive documentation, particularly aimed at existing Rails devs who are well-versed in PHP, would be greatly appreciated as well!

    Have a look into the tests, inline docs and the wiki.

    •  
      CommentAuthorthynctank
     
    Thank you for your detailed response. It clarifies things and also relieves me from fretting over getting every convenient helper method working in Akelos as I'm used to it in Rails. (though I'd love to add in as many as possible as time wears on)

    I must have been mistaken in thinking I'd read the statements about views being as portable as that.

    I'd looked over the unit test files myself in looking for examples of erb-like syntax. (gotta love Grep in Project tmCommand)

    I've also looked over the other documents and the wiki, and found them useful. As I've said I do plan to contribute to the documentation (firstly) and code (secondly) when I have the time. I think initial setup documentation needs a bit of love, and after that I'll go through and fill in as man "red" links as I can in the wiki. You can be sure I'll be blogging about it!

    Thanks again for the response!
    •  
      CommentAuthorthynctank
     
    One more comment regarding sintags. While it's great at what it does (automagically compile this new language into common PHP based on timestamps or whatever) it would be nice if it could write prettier-formatted PHP files.

    Having taken a look at a few of these compiled view templates, the code always seems a bit helter skelter. Is this something intended to be looked at in the future? It's more a nice-to-have than a must-have, obviously.
    •  
      CommentAuthorbermi
     

    Compiled views are no meant to be pretty :), but if you want to contribute that cosmetic change go ahead and submit your patch