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 3879798
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:46:07+00:00 2026-05-19T22:46:07+00:00

how to create a widget out of an existing login action view ? this

  • 0

how to create a widget out of an existing login action view ?
this is what I currently have in my login.php view file of the site’s controller actinLogin()

<div id="login-wrapper">
<div class="login-container">
    <?php $form=$this->beginWidget('CActiveForm', array('id'=>'login-form','enableAjaxValidation'=>true,)); ?>
            <div class="login-input">
            <p>
                <?php echo $form->labelEx($model,'username'); ?>
                <?php echo $form->textField($model,'username',array('placeholder'=>'username')); ?>
            </p>
            <p>
                <?php echo $form->labelEx($model,'password'); ?>
                <?php echo $form->passwordField($model,'password',array('placeholder'=>'password')); ?>
            </p>
            <div id="bmenu">
                <ul class="menu">
                    <li class="register"><?php echo CHtml::link("Registration", array('wsmembers/register'));?></li>
                    <li class="login"><?php echo CHtml::submitButton('Login',array('id'=>'login_button')); ?></li>
                </ul>
            </div>
        </div>
     <?php $this->endWidget(); ?>
</div><!-- .login-container -->
<div class="login-bg-bottom"></div>

if I click the default login link from the navbar, that’s the only time that code above shows
the login box at the upper right corner of the page

but the problem is, the login box should be at the homepage and must already be there
without clicking a login link at the navbar. so how am i gonna do that? this have something to do with main.php layout file right?

  • 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-19T22:46:07+00:00Added an answer on May 19, 2026 at 10:46 pm

    Indeed.

    What you have defined is a view that is used for content. If you click the link the login action will be executed and it it will show the form.

    If you want this to be shown always, just do a Yii::app()->controller->renderPartial on the view. Note that it cannot be $this->renderPartial as you would normally do since the main layout is not executed by the controller. I usually define an alias called “userViews” that points to protected/views so I can do:

    Yii::app()->controller->renderPartial('userViews.site.login');
    

    Or something like that. Hope that helps 🙂

    As for the alias you can add this to your config:

    Yii::setPathOfAlias('userViews', dirname(__FILE__) . '/../../protected/views');
    

    This is assuming your views are indeed under protected views.

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

Sidebar

Related Questions

Here's my setup. I subclassed UIViewController once to create a single Widget view controller
How can I create a widget on the site, such as login forms, dynamic
I have create a widget in android , whenever i click on Widget TextView
Can any one help me out how how this widget can be developed as
I have the below html that is supposed to create a fly out Menu.
Can anyone help me figure out how can i create a widget(Field API) which
I create class Widget, it creates window, this class paints something on the window
I'm going to create widget which needs to update its content every minute (it
I want to create a widget that contains several QDockWidgets on purpose of putting
We want to create a widget platform for a particular website. I couldn't find

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.