I'm working on PageKit CMS (https://github.com/pagekit/pagekit) at the moment. Pagekit works with vue.js...
There is something I do not get at the moment.
I try to add values in my controller like this:
$test = 'MyTestString';
return [
'$view' => [
'title' => $id ? __( 'Edit Team' ) : __( 'Add Team' ),
'name' => 'asc:views/admin/team-edit.php'
],
'$data' => [
'statuses' => Team::getStatuses(),
],
'team' => $test
];
You see? test
is outside the $data
-field. Now I would like to add this to my view:
data: function () {
return {
data: window.$data,
team: window.$data.team,
sections: []
}
},
sounds strange?
Well, I took the example from https://github.com/pagekit/extension-blog/blob/master/app/views/admin/post-edit.js#L8 .
Now if I try to output {{ team | json }}
in my view it's empty :-(
BUT: Echoing out <?= $team; ?>
in the view works. So why can't I output {{team | json }}
?