yii: created and updated, who and when

by prettyscripts on 2010-09-02 15:31:02 • Leave a comment »

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, timestamp, updated, yii

yii: using gii outside localhost

by prettyscripts on 2010-07-30 11:37:13 • Leave a comment »

phpframeworkyii

i'm currently reviewing / learning yii, another php framework. while following the guide to configure gii, i wasn't able to access gii. 403 error was displayed. it's because by default gii only allow access via localhost. if you're like me having a sep… more »

Tags: framework, gii, php, yii

symfony and doctrine: select distinct column

by prettyscripts on 2010-06-16 16:28:27 • Leave a comment »

phpsymfonysql

to select distinct column values from a table, there are a few things to note to make sure only distinct rows are returned. in /path/to/lib/model/doctrine/SomeTable.class.php: public function getDistinctValue() { $q = Doctrine_Query()::create()… more »

Tags: distinct, doctrine, select, symfony

b2evo: hide login from user profile

by prettyscripts on 2010-06-05 02:14:35 • Leave a comment »

phpb2evolution

by default, post author's name is linked to profile page. and by default, b2evolution shows user login on profile page. this raises some security concerns - you don't want the public to know what is your login and you don't want to make it easier for hac… more »

Tags: b2evo, login, profile, user

symfony and doctrine: keep the deleted record

by prettyscripts on 2010-05-21 10:39:38 • 3 comments »

phpsymfony

in most of the projects i work on, when 'deleting' a record, it's preferred to mark it as deleted than actually deleting the record. this makes re-instating a record easier. the common practice is to add a status field to every record. in doctrine, thi… more »

Tags: database, delete, doctrine, symfony