Diem blog syndication

New plugin: dmAlternativeHelperPlugin

Following up from the last blog post announcing the release of Diem plugins, dmAlternativeHelperPlugin just joined the ranks.

What does it do?

The template helpers were designed to be very short. To create an (x)html tag with content, all you had to do was type £('tag', 'content') and you were done. The problem was that most keyboards do not contain the £ (pound) sign, making it difficult and long-winded to develop templates. dmAlternativeHelperPlugin comes to the rescue by providing you with a-little-bit-longer-but-easier-to-type method names to use in your Diem templates:

  • _tag for £
  • _tagO for £o
  • _tagC for £c
  • _link for £link
  • _media for £media
  • _table for £table

How do I get it?

Just update to the latest svn version of Diem, it's included in the core as it needs to be available at anytime. This is because plugins can also bundle templates and thus, can potentially use these alternative helpers.

For people not wanting to update to the latest svn version it is also available in the symfony SVN and has a dedicated symfony plugin page. The plugin has a solid unit test coverage but feel free to test it, ask your questions in the Diem Google group and of course, report any bugs you find in the symfony trac!

The documentation can be found directly on the plugin's page.

Now, a few technical details

Still with me? Good. As you'll hopefully soon be frantically developing your own Diem plugins, I want to quickly go over a few details on how this plugin was done. Believe me, this plugin is very, very simple!

Diem uses the symfony Dependency Injection component to handle extensibility. For this plugin I had to override the helper service and use my own. What I actually did, was simply create a class dmAlternativeHelper (my own helper service class) that extends dmHelper (Diem's default helper service class as declared in Diem core's services.yml) and just proxy our custom helper method calls to their corresponding method in Diem's default helper class. If all that sounds like voodoo to you, here's a glimpse inside the actual code:

dmAlternativeHelperPlugin/config/dm/services.yml

parameters:  

  helper.class:    dmAlternativeHelper  

So, we're just overriding the helper class with our own implementation, pretty simple.

dmAlternativeHelperPlugin/lib/view/dmAlternativeHelper.php

class dmAlternativeHelper extends dmHelper
{  
  public function _tagO($tagName, array $opt = array())  
  {  
    return $this->£o($tagName, $opt);  
  }  
 
  public function _tagC($tagName)  
  {  
    return $this->£c($tagName);  
  }  
 
  ...  
}  

See? Just proxying to Diem's default helper class methods. Using this approach you can clearly see why Diem is incredibly flexible and easy to extend or even bent and changed to your own requirements.

Write your own!

I think that more documentation needs to be written for the developers to really understand all the internals of Diem. I hope with this glimpse I made your mouth water for more. For now, just look at the plugin code that's already been written so far. You can find all available plugins on the plugins page.

Add a comment

Comments

  • convert music filesFebruary 21, 2011 6:50 PM

    Hello.
    Well you got some good ideas there I can certainly try those out tommorrow. If its the motherboard I will still try to get the warranty for it since its not from HP or ASUS its from the store where that computer was bought, I read the fine print on it, it says the whole unit of components of are all covered until august 05, It apparantly doesnt matter if its been moved or not. Either way worth a shot.Is it a rare possibility that the new HD I just got is defective? would these problems suggest that in any way.Originaly when it was installed the computer seemed really quick at opening stuff and that quickly faded to basically as it was before. If I say click on microsoft word for example it takes about 12 seconds to open. At one point a few months ago this was basically instant. Everything is just seeeming so slow at processing. Saving 1 page MS Word document to HD 15 seconds. Thats insane.I just defraged this morning, no spyware according to 3 programs, no viruses, and all updated definitions for all 4 programs.Oh yeah and this might or might not be important but I forgot to post this originally and a few times after that. When I was copying the ripped DVD to DVD9 the computer was louder then I have ever heard it before. It however is very quiet when compressing to DVD5, And it acts this same way everytime.Sorry I forgot to post that before.Either way regardless of anything I think I might just get some new RAM and a Motherboard anyways then I could actually have the features I need in a motherboard. But will try your ideas first of course just to see what all happens.

    <a href=http://www.topvideoconverter.com/hd-video-converter-mac/>hd video converter for mac</a>

  • ethirucheMarch 22, 2011 7:49 AM

    Usually I do not see the article on the blog, but I want to say, this forced me to write to try and do it very! Your writing style has surprised me. Thank you, very good job.
    I really like the theme design of your website. Have you met any browser compatibility issues? On my blog a few passengers complained that my blog does not work, but in Explorer to find great drama. Do you have any suggestions to help solve this problem?
    My partner and I just love reading this blog, I know you want to do business only selected articles? I always try to find someone to trade, just thought I would ask.
    Hey! MySpace was in my group and share this site, so I'll see it over. I absolutely love the information. My bookmarks and chirp that my followers! Special blog and careful design.
    Manolo Blahnik.This cortex is a good pair of high heels, and very beautiful, quality must be very good, very comfortable to wear in the feet, very beautiful.

  • VartmenotohomMarch 30, 2011 5:05 AM

    I have been in the system to locate a large amount of specialized articles to deal with this issue, such as: <a href=http://www.script-error.info/>internet error script error</a>
    mentioned in the content. But for me, It is very challenging. I think I must do to find software that helped me to! Who can suggest a to me? Thank you.

  • FrankMBMay 19, 2011 12:45 AM

    &#1502;&#1497;&#1491;&#1506; &#1506;&#1500; <a href=http://nituah.wordpress.com/>&#1504;&#1497;&#1514;&#1493;&#1495;</a> &#1500;&#1505;&#1493;&#1490;&#1497;&#1493; &#1492;&#1513;&#1493;&#1504;&#1497;&#1501;

  • EaseshyGlydayMay 23, 2011 11:39 PM

    http://www.darkoceanstudios.com/forums/profile.php?mode=viewprofile&u=329830

  • pooppisrehelDMay 25, 2011 1:24 PM

    <a href=http://es5.com><img>http://www.blackhatseo.com/images/black-hat-seo.jpg</img></a>

    Whats up <a href=http://www.blackhatworld.com><img>http://es5.com/images/smile.gif</img></a>

    I'm trying to find a <a href=http://es5.com/link-building/><b> Blackhat</b></a> traffic software to elevate our traffic. I'd take pleasure with any kind of variety of SEO and Web exposure

    If you know anyone in the position to aid targeted web traffic and with <a href=http://es5.com><b>White Hat</a></b> Tools. I want to study how to promote and market of internet products and websites.

  • Elli.ANovember 18, 2011 1:02 AM

    Sometimes things are not working as forecasted, thats life....

    regards,
    Elli

Fork Diem on GitHub