Hi, I just want to ask if modx supports or plans to support OOP such that I want to do this:
+x.y()]]
+x.z]] <-- where z triggers the __get() magic function
c::d()]] static function
is this possible through modx?
edit: ahh brackets got interpreted as bbcode
[ed. note: albert.diones last edited this post 15 years ago.]
-
☆ A M B ☆
- 24,524 Posts
Hmmm this is kinda weird, I was asking if I can do this on resource contents, templates and chunks. thanks.
-
☆ A M B ☆
- 24,524 Posts
Contents, templates and chunks are pure HTML code. Snippets are for inserting the return value of PHP code.
-
MODX Staff
- 10,725 Posts
Albert:
We do not use the magic getters and setters in PHP, and this was a conscious decision. Though magic, and seemingly useful, they can also be a huge problem, which we chose to avoid. MODX uses xPDO which uses a generic get() and set() method anyway.
That said, you can write your own magic __get() and __set() implementations in custom classes that wrap anything MODX you wish to.
hi open, yeah I am talking about my own classes, do you mean using snippets to set static placeholders?