soo_txp_obj Page 1 of 6

soo_txp_obj

Summary:

Object-oriented library/framework for writing Textpattern plugins

soo_txp_obj is a plugin support library for the Textpattern content management system. As of 7/5/2009 it is a beta release; it is expected that subsequent releases will not (significantly) break compatibility with it, but this is certainly not guaranteed.

Why use a library? Obviously there is overhead in getting familiar with it, and it’s probably not worthwhile if all you’re doing is writing quick and simple plugins. But for larger projects you may find that a library such as soo_txp_obj pushes many mundane details into the background and allows you to stay focused on the bigger picture. Just to cherry-pick a simple example from my own code, this kind of thing gets tiresome quickly:

$sort = $sort ? " ORDER BY '" . doSlash($sort) . "'" : '';
$limit = $limit ? "' LIMIT '" . intval($limit) . "'" : '';

Using soo_txp_obj I can do this instead:

$query->order_by($sort)->limit($limit);

soo_txp_obj is for making database calls and producing HTML tags. There’s also a class for dealing with URI query strings.

This brief guide contains examples and simple tutorials. Full API Documentation also available.

Contents

Posted 2009-01-20 (last modified 2010-07-09)