| Page 1 of 1 | [ 8 posts ] |
|
What is the meaning of this type wave thing in documentation:
http://developer.yahoo.com/yui/3/api/YUI~dump.html What does it mean: Class YUI~dump What's the deal with ~ This is the first time I see this in any documentation. Also, the real question is how to use the dump in logging? Suppose I want to get contents of the object Should I use Y.log(Y.dump(o)) <- This does not work by the way, says "Object [object Object] has no method 'dump'" So how do I use dump? Thanks. |
Juan Ignacio DopazoYUI Contributor
|
You just need to use the "dump" module.
Code: YUI().use('dump', function (Y) { var o = { hello: 'world' }; Y.log(Y.dump(o)); }); |
|
Thank you. I liked it better in YUI2 when it was something like Y.Lang.dump()
|
Juan Ignacio DopazoYUI Contributor
|
Actually, it's still there. Y.Lang.dump === Y.dump.
|
|
Do you mean, in YUI3 I can use Y.Lang.dump just like in YUI2? Do I have to load any modules?
|
Juan Ignacio DopazoYUI Contributor
|
You can use Y.Lang.dump() but you still need to load the "dump" module
|
|
It's my understanding that the tilde (~) character is a YUI3 convention for "this thing hangs directly off the YUI object you get back from the use function, even though it's a separate module."
So YUI~dump gives you Y.dump YUI~oop gives you Y.extend, Y.augment, etc. |
|
The tilde was just a convention in documentation to indicate that the module attached functions directly to the YUI instance rather than providing a separate namespace.
This is a moot point, though; the tilde notation has been removed from the latest YUI documentation. This is the current style for displaying module-based extensions to the YUI instance. |
| Page 1 of 1 | [ 8 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group