Wrapping certain elements in a matrix with a matrix with PHP

I have a function that is doing this correctly, but I feel that this can be done (possibly) with a minimal code, with recursion, but I am only destroying my brain. Basically I have JSON that is decoded to an array. What I want to do is convert this:

{
"parentView": {
"childViews": [
      {
        "type": "container-fluid",       
        "childViews": [        
          {
            "type": "row",  
            "childViews": [            
              {
                "type": "slider"
              },
              {
                "type": "slider"
              }
            ]            
          }
]}
]}
}

Within this:

{
"parentView": {
"childViews": [
      {
        "type": "controller",
        "childViews": [
          {
            "type": "container-fluid",       
            "childViews": [        
              {
                "type": "controller",
                "childViews": [
                  {
                    "type": "row",
                    "childViews": [            
                      {
                        "type": "controller",
                        "childViews": [
                          {
                            "type": "slider"
                          }
                        ]
                      }
{
"type": "controller",
"childViews": [
                          {
                            "type": "slider"
                          }
                        ]
                      }
]}
]}
]}
]}
]}
}

Here is the code I'm using to make it work the way I need it. I'm just looking for a cleaner method:

createControls ($ parentView) function
{
$ newArr = $ parentView;

foreach ($ parentView as $ k => $ v) {
$ newArr[$k] = [
            'type' => 'control',
            'childViews' => $v
        ];

yes ($ v['childViews']) {
foreach ($ v['childViews'] like $ kk => $ vv) {
$ newArr[$k]['childViews']['childViews']    = [
                    'type' => 'control',
                    'childViews' => $vv
                ];

yes ($ vv['childViews']) {
foreach ($ vv['childViews'] like $ _k => $ _v) {
$ newArr[$k]['childViews']['childViews']['childViews']['childViews'][$_k]    = [
                            'type' => 'control',
                            'childViews' => $_v
                        ];
}
}
}
}
}

returns $ newArr;
}

$ newArr = createControls ($ arr['parentView']['childViews']);
$ arr['parentView']['childViews']    = $ newArr;

Thanks in advance!
Best regards!