I simply want to dump the value of a variable saved in Kirby using PHP’s var_dump()
function. If I do the following:
<?php var_dump($page->title()->html()); ?>
I expect to get something like:
string(5) "About"
What I get instead is a gigantic object (around 900 lines and nearly 500kb) that contains all the data of the entire site. All I want is to see the actual variable I asked for (in this case, the value of the page title) and not everything else.
object(Field) #90 (3) { ["page"]= > object(Page) #71 (11) { ["kirby"]= > object(Kirby) #3 (15) { ["roots"]= > object(Kirby\ Roots) #4 (1) { ["index"]= > string(31)
"/Users/<username>/Dev/<sitename>"
}["urls"] => object(Kirby\ Urls) #5 (8) { ["index"]= > string(35)
"http://dev.<sitename>:8888" ["indexDetected"] => bool(true)["content"] => NULL["thumbs"] => NULL["assets"] => NULL["autocss"] => NULL["autojs"] => NULL["avatars"] => NULL
}["cache"] => object(Cache\ Driver\ Mock) #14 (1) { ["options":protected]= > array(0) {}
}["path"] => string(5)
"about" ["options"] => array(36) {
["tinyurl.enabled"] => bool(true)["tinyurl.folder"] => string(1)
"x" ["url"] => bool(false)["timezone"] => string(15)
"America/Chicago" ["license"] => string(32)
"1940dc58ec98de46245b5f1545589044" ["rewrite"] => bool(true)["error"] => string(5)
... Plus 900 more lines
Why do I get this gigantic object when I’m asking for a subset of it, and how do I get around that?