Commit 741eac60 authored by Stefan Busemann's avatar Stefan Busemann
Browse files

[TASK] Add show action

parent 86de723c
......@@ -4,8 +4,10 @@ declare(strict_types=1);
namespace T3o\T3omy\Controller;
use T3o\T3omy\Domain\Repository\MyProfileRepository;
use T3o\T3omy\Domain\Model\MyProfile;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager;
use TYPO3\CMS\Core\Messaging\AbstractMessage;
/**
* Class UserController
......@@ -38,8 +40,22 @@ class MyProfileController extends ActionController
$this->persistenceManager = $persistenceManager;
}
public function showAction () {
public function showAction (MyProfile $user = null) {
if ($user === null) {
$user = $this->myProfileRepository->findByUid(
$GLOBALS['TSFE']->fe_user->user['uid']
);
if ($user === null) {
$this->addFlashMessage(
'Something went wrong. We were not able to find your profile found!',
'Profile can not be shown',
AbstractMessage::ERROR
);
}
}
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($user, __FILE__ . '@' . __LINE__);
$this->view->assign('user',$user);
}
public function editAction () {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment