EView and such

So I've recently added some awesome things to EView. Well, awesome potential at least.

I've added a few very nifty keywords

{!if x==10!}
  X is 10 yay!
{!endif!}

(including if, elseif, else, and foreach variants)

I've added the layout and layout_field keywords, which make masterpage-content crap hella awesome.

and most recently, I've revamped the helper support to actually be useful. For instance, an example for a hyper link is:

{?Hyperlink Location="http://google.com", CssClass=SomeFunction(), Text="foo bar"?}

And the hyper link helper is easy to create also, and is created from the EView T4 template.

One problem I've just thought of though is that when making a base template, you won't be able to have very good inheritance. This is because EViewRender currently does not call base.EViewRender(). To be honest, I'm pretty sure there is no way to have good inheritance for views. What would the relationship even mean? But nonetheless, you can create base classes so that for instance you could have

abstract class HtmlHelper : IEView{
  public string CssClass{get;set;}
}

so that you're not defining CssClass everywhere.

Only thing I need now is to implement some helper functions. I'm thinking of going through the basic HTML tag list. One of the more interesting ones will probably be <select> as that will take an enumerable of some sort. Meh, I'll figure it out when I get there :P

Posted: 3/12/2011 3:07:14 AM

We all make mistakes

Well, I was trying to not tie my website to MVC just for example sake, but I'm basically reinventing MVC the more I get into it. MVC isn't bad, but I'm not convinced it's the cure-all for every website like everyone else does.

Anyway, I could add some really neat possibilities to EView and EFramework by merging the two and making them directly dependable on each other. Well, EView I'd like to keep fairly independent because it has uses outside of the web. But EFramework I think could be a lot easier to use if views were built into it. This would allow me to make a few more assumptions making things easier for both me and the implementors.

But meh, I'll keep it how it is for now.

Posted: 3/9/2011 1:04:09 AM