Archive for category ‘Work’
I am working on some stuff for work (yes, on the weekend) that uses the Codeigniter Template Parser class to display content with pseudo variables. I have a pseudo variable parser that allows me to call up a certain function from a certain helper file. To do this I would do something similar to this:
{ns:gallery['foo']}
Where “df” is the name of the helper file (minus “_helper”) that gets loaded in if it hasn’t been already, “gallery” is the name of the function, and everything inside the brackets are values that get passed to the function.
I also thought about doing something more like HTML tags with pseudo variables. So the above example could be:
{ns:gallery name='foo'}
Similar concept but this way all of the attributes could be thrown into an object when it gets o the function so I can have as many or as few settings in it as I want instead of having to pass a certain number of arguments in a certain order. I would have to have default values for everything in case an attribute I needed wasn’t passed. Same idea as the way HTML tags work.
This is basically like creating my own pseudo HTML tags with { and } instead of < and >. So then I thought, why not make it a namespace tag? I would just have to replace the { and } with < and > and I get:
<ns:gallery name='foo' />
To do this I would so something similar to this post titled ‘Parsing Custom Tags With PHP‘.
There are advantages and disadvantages to all three. Right now I am leaning more toward the second or third options because if someone goes in after me and needs to edit the file, I think that makes more sense than the first way. Any way I go it just means extending the Codeigniter Template Parser class. Maybe I’ll do all three and release it to the Codeigniter community.
I was thinking about some of the sites I have worked on. I started trying to remember the very first website I worked on as a professional developer. I couldn’t remember what it was. Keep in mind this was back in 1998 so it has been a while. So I messaged my old boss and asked him.
The very first website that I ever worked on was an event calendar. A lady just found out her daughter was a lesbian. In order to be supportive, we decided to make a website of all of the upcoming events in gay and lesbian community. Unfortunately, the site is no longer online. It would have been fun to see how it had progressed since I last worked on it.
