Aaron Harp

30Aug/0856

PHP Scaffold Class

Update: This class has been released and is now available for download.

I've done web development for quite some time now and I hate writing CRUD as much as the next guy.  As a developer your goal should be to not ever write the same code twice.  But when creating CRUD systems for different projects this is impossible.  You always find yourself doing the same thing, over and over again.  Most coders have been enticed by Ruby on Rails's "weblog in 15 minutes" screencast.  There are also PHP frameworks that boast the same functionality.  I've never had the desire to learn any of these systems and, honestly, EzSQL teamed with Smarty gets the job done quite nicely.

A few years ago I ran across this article and ever since I have been building on the ideas presented to create an extremely powerful PHP Scaffold Class that I have used in numerous production sites.  In it's simplest implementation, all you do is pass the table name to the class and the scaffolding is created based on the table's structure.  Over time I've added functionality for table relationships, image uploading and resizing, and more.

I imagine this class could be very useful to the PHP community.  I plan on refining it further and eventually making it available to the public.  My purpose in writing this post is to find out if there's any interest in this sort of thing and to see if, and how much, people would be willing to pay for a license to use it.  Your feedback is welcome in the comments below.

Features

  • Parent/Child relationships
  • Image uploading and resizing
  • Thumbnail generation
  • WYSIWYG text fields
  • Disable certain actions (show, add, edit, or delete)
  • Handles SET or ENUM fields as select boxes
  • Sort by any of the columns
  • Pagination
  • Hide different columns from the listing table or from all views
  • Automatic recognition and handling of created and modified date fields
  • Extremely flexible

Demo

I've setup an example of a simple store backend to show its functionality.  You can view the code and database structure by clicking the links at the top.  Here is an example of a frontend that has been built on top of a backend powered by this class.

Filed under: Technology 56 Comments
25Aug/082

A post, just to post

Hopefully some sort of inspiration will be found by the end of this.  If not, I'm sorry that you had to read this.  Let's see...

I've been back from West Texas for a couple of weeks now.  I meant to write about my revelations but it never  happened.  The main revelation was this: no matter how busy or un-busy you are, time still must be made for those things you "never have enough time for".  This post is a case in point.  Oh, how I need to be more disciplined.

Last week I endured placement exams, auditions, and parking tickets.  Now that that's all out of my system I am beginning "classes" this week.  Classes is in quotes because my classes are really just rehearsals and lessons; quite a change from undergrad work.

Yesterday Chelsea and I ate at Mr. Chopsticks and I had a really great curry.  If you're ever up in the Denton area I will treat you to some tasty chopstickable food.  Speaking of chopsticks...

Filed under: Life 2 Comments
18Jul/083

The Post of 100 Words

  • Settlers of Catan is the best game in the world.  We have a hate/love relationship.
  • It's almost time for Camp Meeting again.  Hard to believe.
  • Chelsea and I just recorded a song for her grandma's birthday.  I'll upload it in the next couple of days.  I may also upload some demos of a few new songs I've written.
  • N.T. Wright's Surprised by Hope is proving to be a good choice.  More on that to come.
  • My blog is now on a new, faster server.  I frequent it just to watch how fast it loads.
  • Today is the first day since Sunday that I haven't had "Viva La Vida" stuck in my head.
Filed under: Uncategorized 3 Comments
10Jul/0813

WordPress Plugin: Manageable

I was recently motivated by a certain post about a plugin competition to put my nerdiness to good use and create a plugin that will (hopefully) be useful to my fellow WordPress-ers.

Whenever I have to go in and edit multiple posts or pages on my site, it always drives me nuts having to open each page, scroll down and find the box I'm looking for, make the change, click save, go back to the listing page, find where I was, and repeat.  I know we're just talking about a few extra clicks, but in cyberspace a few extra clicks is like trudging through a mosquito infested swamp.  Maybe not.

Manageable is my remedy.  Basically, you can edit all of the data related to a post or page (all except the actual content) using a simple Ajax interface.  This means you never leave the management panel.  So check it out and let me know what you think.  And if you're so inclined, you can vote for it here.

6Jul/088

Jesus Isn’t Patriotic

I walk into the church doors hesitantly every year on the Sunday closest to July 4.  Red, white, and blue button-up ties and button-up shirts, patriotic anthems, and talk of the good ol' days when America was a Christian can pretty much be expected.  To preface this post, I'm not anti-America.  I just feel like Americans, especially Christian Americans, are a whole lot more pro-America than God is.  It might sound rash, but in many cases I think nationalism inside the Church constitutes idolatry.  I will give examples of what has made me feel this way.

Last Memorial Day happened to fall on the Monday right after Pentecost Sunday.  The only reason I knew Pentecost was approaching was that I had seen something about it on the website of my friend's Anglican church.  I went to church that Sunday in great anticipation of celebrating the descent of the Holy Spirit, the coming of "another Comforter".  No mention was made.  But we did have a section of the worship set aside for remembering the people who died while protecting our blessed freedom.  This isn't the only case of national holidays superseding Church holidays.

Today in Church this verse was quoted multiple times in reference to our nation:

If my people, who are called by my name, will humble themselves and pray and seek my face and turn from their wicked ways, then will I hear from heaven and will forgive their sin and will heal their land.  (2 Chronicles 7:14)

That's a great passage, but unfortunately it was written a couple thousand years ago and it's not talking about the United States.  After Jesus' blood sealed the New Covenant His nation became the Church worldwide.  That's the beauty of Jesus' death: Gentiles—most of the people reading this—were given access to God's grace.  Yes, if His people (Christians) would turn from their wicked ways, he would hear from heaven and heal our land (the Church).  Stating that a nation is God's is a dangerous thing; its actions no longer require justification.  It's time manifest destiny was laid to rest.

Lastly, here are some photos that, I think, give a glimpse into the mindset I've been describing: 1, 2, 3

It seems like nationalism has become our excuse.  "If only America would legislate Christian principles (life before birth, heterosexual marriage, etc.) then the Church would be the life-transforming community is should be."  Reading the New Testament you find Jesus avoiding the political realms.  He could have easily taken a governmental position, ensuring his following.  Instead, he went around with twelve common men, ministering to common people, teaching the world a very uncommon way to live.  Let's turn our focus to ridding worship of impurity so that we can experience Christ both corporately and individually in ways that transform within and without the doors of American churches.

Filed under: God, Politics 8 Comments
WordPress Lightbox 2 by Zeo