-
MODX Staff
- 2,502 Posts
I could be wrong, but what I think you are looking for might be here:
http://rtfm.modx.com/revolution/2.x/developing-in-modx/other-development-resources I don't get the API docs either. I am not a php developer though. I just want to know what classes and methods are available and how they get used.
Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup
magician.
Blog ✦
Twitter ✦
LinkedIn ✦
GitHub
-
☆ A M B ☆
- 24,524 Posts
http://api.modx.com/revolution/2.2/ - but in my opinion this isn't really API documentation. It's just the automated docs created from the comments in the files. While you can find out what properties and methods are available for all the MODx and xPDO objects, there's no help in how they can be used.
Quote from: smashingred at Nov 20, 2013, 07:24 AMI could be wrong, but what I think you are looking for might be here: http://rtfm.modx.com/revolution/2.x/developing-in-modx/other-development-resources I don't get the API docs either. I am not a php developer though. I just want to know what classes and methods are available and how they get used.
I've said this before, but the API docs should not be listed under "Other Development Resources" since a) people won't find them there and b) API docs are arguably the *main* development resource.
@Gav: There's documentation of most of the MODX and xPDO API in the Appendix of my book. It should be enough to get you going unless you're trying to do something exotic. The forums here are also an excellent source of API information -- just ask.
MODX should really have something like php.net for online documentation. Out of all the API docs I've seen and used over the years, it's by far the best, imo.
-
☆ A M B ☆
- 24,524 Posts
Indeed. My PHP development would come to a screeching halt without php.net!
Funny that they just re-designed php.net
http://www.php.net/archive/2013.php#id2013-11-20-1
(I like it)
Quote from: mrhaw at Nov 21, 2013, 12:23 AMFunny that they just re-designed php.net http://www.php.net/archive/2013.php#id2013-11-20-1
(I like it)
So they have.
I find it mildly disturbing after seeing the old style for so long.
-
☆ A M B ☆
- 24,524 Posts
Every object has a get() method; that's inherited from the most basic "object" object. Here's what the docs say about modUser and its get() method - not very friendly, it needs examples.
Get a field value (or a set of values) by the field key(s) or name(s).
Inherited from: \xPDOObject::get()\xPDOSimpleObject::get()\modPrincipal::get()
Warning: do not use the $format parameter if retrieving multiple values of different types, as the format string will be applied to all types, most likely with unpredicatable results. Optionally, you can supply an associate array of format strings with the field key as the key for the format array.
Parameters
Name Type Description
$k string | array
A string (or an array of strings) representing the field key or name.
$format string | array
An optional variable (or an array of variables) to format the return value(s).
$formatTemplate mixed
An additional optional variable that can be used in formatting the return value(s).
Returns
Type Description
mixed The value(s) of the field(s) requested.