Closed qodeboy closed 6 years ago
Hi @qodeboy!
That's right, ::value()
is a method which comes from PrimitiveValue
abstract class, so only primitive values (non-objects) have this feature.
As converting object to string is not quite trivial thing and as it's a bit higher abstraction then this extension provides, you'll have to do it by yourself, probably, by iterating over properties and output key-value pairs. Alternatively, you can use JSON:stringify()
method to get serialized object representation (it will work for any Value
, actually).
I'm moving away from PHP world and all my PHP projects going to be abandoned too. Abandoning this project too as I have no intent to continue working on it unless there would be strong request from community and commercial interest. No more updates or documentation will be made. If someone is interested, feels free to contact me using email specified in my GitHub profile.
Trying to extend bundled example to work with object, I'm not able to get value. Consider following code:
I understand that return value is no longer
StringValue
butObjectValue
instead. How do I properly get it's value?My use-case is rendering VueJS app on server to implement server side rendering. For this, I need to execute some wrapper javascript and app itself on the server. This js code results in
ObjectValue
just like my example above. If I try to do$result->toString($context)->value()
I get[object Object]
which is not usable. What is a correct way to do this?