Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7193611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:12:19+00:00 2026-05-28T20:12:19+00:00

i use cakephp and i want create login element . this layout work as

  • 0

i use cakephp and i want create login element .
this layout work as :
1- when i should login , that element should show this code:

echo $this->Form->create('User', array('action' => 'login'));
echo $this->Form->inputs(array(
    'legend' => __('Login', true),
    'username',
    'password'
));
echo $this->Form->end('Login');

2- when i logged and element should show my information such as username or email.
if i use view i can use $this->Auth but i can’t use this way , there is another way for elements , thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T20:12:20+00:00Added an answer on May 28, 2026 at 8:12 pm

    You could get information of loggedin user from session in elements, like:

    
    //check if user is logged in
    if (!$this->Session->read('Auth.User.id')) {
      //show your login form here
    }
    else {
      //the user is loggedin
      //get the loggedin users's information from session
      $username = $this->Session->read('Auth.User.username');
      $email = $this->Session->read('Auth.User.email');
    }
    
    

    Did you mean something like that

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use Notepad++ and Aptana for editing my CakePHP code? Is there any way
I work on a Webproject using jQuery and CakePHP. I use jeditable as an
I want to use the CakePHP Helper time and his method niceShort to transform
I have some images inside links that I want to essentially look like this:
I'm using cakephp to build a survey and want to use javascript (specifically jquery
I'm using a simple registration form for CakePHP. This is my edit view: <h2>Add
I'm redesigning site that use CakePHP, and till now everything goes well because I
I want to have cakephp paginate data and still use containable , but for
I am using CakePHP to create a simple blog for myself. I want to
In CakePHP we can use $this->Auth->allow('someMethod'); to make a page viewable without having to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.