A web developer's blog. PHP, MySQL, CakePHP, Zend Framework, Wordpress, Code Igniter, Django, Python, CSS, Javascript, jQuery, Knockout.js, and other web development topics.

Tag Archives: objects

A Basic Python Class

This is the basic structure of a Python class. >>> class Simplex: … "An example class""" … def __init__(self, x, y): … self.a = x … self.b = y … def addition(self): … return self.a + self.b … >>> z … Continue reading

Posted in General | Tagged , , , | 1 Comment

PHP: Using an object property with a dash

Earlier at home, I recently encountered this problem when I was using Zend_Service_Twitter to get the rateLimitStatus of API calls. One of the values returned by the successful API call contained a dash(-); I needed to do something like this … Continue reading

Posted in General | Tagged , , , , | 2 Comments

PHP: Using variables for calling object properties

I had a scenario at work today that need me to use a variable in an object and call it like I would when using keys in an array. Like when I have an array, I would do something like … Continue reading

Posted in General | Tagged , , , | 5 Comments