blog site of branko ajzele, senior developer / project manager

PHP tricks, converting variable to method

Yesterday I was playing with Magento. Checking out the source code (methods, classes). I found an interesting class called Mage_Core_Model_Config_Options. Interesting because of the way you call methods from it. To be honest, I did not know that one can store string name into the variable and if that name is the same as the name of some method inside the class you can call that method using that variable...

PHP form data binding

I am working on a project that has a lot of user input forms. Forms are used to submit entries to MySQL database. Submitting values to forms and processing them trough some PHP logic is no news for PHP. The problem I encountered while developing my application was the mapping of values from database to $_POST variables and vice verse. This may not sounds like a that big of a deal but when you have more than a dozen...

Setting up FirePHP with CodeIgniter

I have been using FireBug for some time now. Although his prime purpose is for JavaScript debugging I use it mostly for fast drilling down to CSS stuff. I just love the possibility to change, delete or add CSS properties on HTML document on the fly. Anyway I like FireBug. In absence of one for all IDE it’s quite decent solution for debugging. Contrast to JavaScript development I do a lot of PHP development....

PHP tricks with object oriented programming

Programming PHP the right way as with any other OOP language requires knowledge and understanding of OOP concepts. For those of you who don’t know this by now, OOP stand for Object Oriented Programming. Working on a small project where developer goes trough just a few files is a no problem since your most likely memorize all your properties and methods. However, working with big project like Magento, or even...

PHP, the things I hate in language I love

Strange function names. Strange, silly, stupid and so on. Call them whatever and however you want. As to my knowledge, PHP originally had function names combining multiple words as one like “dosomeactionfunction()”. With time, community realized this is not so good practice so they decided using underscored function names like “do_some_action_function()”. Personally I hate underscored names...

« Previous Entries

Powered by Wordpress | Designed by Elegant Themes