Ad
October CMS Backend Form Field Get Backend Username
How can I get the backend user's name and output it on the backend form field using a partial.
Ad
Answer
Every partials which are render in back-end has "user" object within in it.
and this object is pointing to current logged in back-end user.
so if you want to add that user's fisrt_name in partial you can do something like this.
<?= $this->user->first_name ?>
but from you code I can sense that you want to use use-name and try to use it as key for $value array and get inner value of $value array
so first {{ }} this will not work inside php tags, instead good news you can directly use php code there :)
your solution:
<?= $value[$this->user->fisrt_name] ?>
you can replace attribute first_name to another column attribute which will appropriate to you.
if any issue please do comment.
Ad
source: stackoverflow.com
Related Questions
- → OctoberCMS Backend Loging Hash Error
- → "failed to open stream" error when executing "migrate:make"
- → OctoberCMS - How to make collapsible list default to active only on non-mobile
- → Create plugin that makes objects from model in back-end
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → How to install console for plugin development in October CMS
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → How to update data attribute on Ajax complete
- → October CMS - Conditionally Load a Different Page
Ad