Render partial

I have a function where most values are rendered through json. There is one value thought that need normal /partial rendering, but I cant get it to work, or better said, I simply looking to long at it. This is what I have:

//Controler

$user_id   = new View('/admin/user_id.php', compact('user_info'));
$user_id->render();

//user_id.php

<input name="user_id" id="user_id" type="hidden" value="<?= $user_info['user_id']; ?>">

But I keep getting undefined index user_info

What am I doing wrong? Thank you in advance

$user_info does not contain the value you expect.

It does since for the values i use in Json I can return the uer_id

Edit. What else approach should I take?

since I don’t know how your template engine works, I can’t tell.

When I add the value to the json array it works just fine, but that is not an option since I need the value for a form field

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.