php: convert string to slug

by prettyscripts on 2010-09-29 12:10:38 • Leave a comment »

php

there's no standard slug function in php. most softwares nowadays comes with function to slug-ify a string to format seo friendly url. but working on a standalone program, this is what i come up with based on some google search results. function to_sl… more »

Tags: php, slug, string

b2evo: change default empty text

by prettyscripts on 2010-09-27 11:35:59 • Leave a comment »

phpb2evolution

when there's nothing to display or when there's nothing in search result, the following message is displayed:sorry, there's nothing to display... to change this text, locate display_if_empty() in template and add a new parameter, so it looks like… more »

Tags: b2evo, empty, text

css: box around floating elements

by prettyscripts on 2010-09-20 16:25:00 • Leave a comment »

csshtml

a common problem with when trying to box 2 floating elements, you see a zero-height box align to the top of the floating element. eg, we have the following layout:<div class="container"> <div class="left">left column</div>… more »

Tags: box, css, float

starting an yii-based project

by prettyscripts on 2010-09-09 15:37:45 • Leave a comment »

yii

note: v1.1.4 was used at the time of writing. a workable yii project skeleton is created with command line:/path/to/framework/yii webapp /path/to/project there are certain aspect of the generated skeleton i don't like. such as the main project file… more »

Tags: framework, project, startup, yii

yii: created and updated, who and when

by prettyscripts on 2010-09-02 15:31:02 • 5 comments »

phpyii

most data have created_date, created_by, updated_date and updated_by columns to audit records. in yii, these columns can be automatically updated via these 2 behaviors:CTimestampBehavior - a standard zii behavior that is distributed with yiiBlameab… more »

Tags: behavior, created, extension, modified, timestamp, updated, yii