How in modx revo to get the id of the current resource through PHP?

Create a plugin that will create a folder in a specific directory for it, and I need to get ID of the resource.
<?php
$namepapka = esoslugares;
mkdir("..../assets/files/$namepapka", 0700);</code-->
br><br> PS I changed this:<br> <a href="http://gaserge.ru/blog/modx-revolution/udobnyij-zagruzchik-fajlov-dlya-modx-revolution-sredstvami-migx.html" rel="nofollow">gaserge.ru/blog/modx-revolution/udobnyij-zagruzchi...</a>
July 9th 19 at 10:23
2 answers
July 9th 19 at 10:25
Solution
$modx->resource->get('id');
I so got him. - Hattie.Purdy28 commented on July 9th 19 at 10:28
July 9th 19 at 10:27
can somehow so
$lastid = mysql_insert_id();
Not here need something like modx API $resource = $modx->getObject('modResource', $id);
But I don't know how to get it and where to peep - Hattie.Purdy28 commented on July 9th 19 at 10:30
the idea should be in the documentation - Hattie.Purdy28 commented on July 9th 19 at 10:33
//$id = $modx->resource->get('id'); - not working
$content = $resource->get('id'); //works - Liliana_Hickle82 commented on July 9th 19 at 10:36

Find more questions by tags PHPMODX