Results 1 to 2 of 2

Thread: No data member in template

  1. #1
    User
    Join Date
    09-15-09.
    Location
    France
    Posts
    98

    Default No data member in template

    Hi,

    How to have data member in template ?
    This code with Contao 3.3.6 not working
    Code:
    if (FE_USER_LOGGED_IN)
    {
    $this->import('FrontendUser', 'User');
    echo $this->User->id;
    }

  2. #2
    User Andreas's Avatar
    Join Date
    07-11-09.
    Location
    Mönchengladbach
    Posts
    484

    Default

    I can not confirm this on C 3.3.7. Are you sure a member is logged in into FE?

    You also can use the modern way
    PHP Code:
    echo \FrontendUser::getInstance()->id;
    // or if you  need more variables
    $objMember = \FrontendUser::getInstance();
    echo 
    $objMember->id
    Web-Development, Freelancer, Burgtech, XHTML, HTML5, CSS, PHP, Javascript, MooTools, MySQL and more
    Amazon wishlist

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •