Closed mittus closed 7 years ago
Yes, it's right and that's correct, because you are saving only a standard Item
object, but you are trying to display an SimpleItem
object.
Either you will have to save an SimpleItem
object in your create_review() function too, or you will need to use the standard Items to display these on your page.
For saving SimpleItem
object you can simple extend your create_review() function with following lines, after the $item->save()
for instance:
...
$item->save();
$itemMapper = imanager()->getItemMapper();
$itemMapper->alloc(1);
$itemMapper->simplify($item);
$itemMapper->save();
Be careful during saving unfiltered user input:
$item->name = $rname;
better:
$item->name = $imanager->sanitizer->text($rname);
By using "setFieldValue()" method, the content will be sanitized automatically.
It's work, thank a lot!
When I create Item from function, I can't see them on page. It's appears on ItemManager page, but not dysplayed on site page.
Code for display Items:
Function, that create Item after form submit:
I can dysplay this Item only if update them on ItemManager page.