Hi, i put querry from main.html to entryPoint, in entryPoint i'm trying getUser() -> get('name'), but have no access. How i can fix it?
Announcement
Collapse
No announcement yet.
Access to entities and user from GET
Collapse
X
-
Problem is solved. I Add \Espo\Core\EntryPoints\Base to extends, so my code looks:
<?php
namespace Espo\EntryPoints;
use \Espo\Core\Interfaces\Injectable;
use \Espo\ORM\Entity;
class EP extends \Espo\Core\EntryPoints\Base
{
public function run()
{
$user = $this->getUser();
$userId = $user -> get('name');
$put_content = file_put_contents ( 'log.txt' , $userId );
echo $put_content;
}
}
?>
Comment