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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T05:53:43+00:00 2026-05-19T05:53:43+00:00

hey, Since a few weeks I’m try to program a PHP-Application with the smarty

  • 0

hey,
Since a few weeks I’m try to program a PHP-Application with the smarty template solution.
Now a easy question for all professionals:
How can I get a Template in a Template ?
One example:
index.php (page.tpl) include my login.php (login.tpl)

In the smarty documentation I have found this function:
{include file="$tpl_name.tpl"}

But where is my login.php controller ? When this function include the login.tpl file,
I have only HTML code or ?

Can someone explain me this or give me a sample / tutorial ?

Sorry for my bad english

best regards

  • 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-19T05:53:44+00:00Added an answer on May 19, 2026 at 5:53 am

    Basically the login.tpl file in your case has to be an ordinary Smarty template (so it may contain html tags as well as Smarty tags). You can’t include another controller from Smarty.

    As far as I understand, you want to add login functionality to your index page. This can be done in the following way:
    1) Include login.tpl to index.tpl, so you will have the login form included in your index page.
    2) Specify different action for your login form, e.g. “login.php”, so this login.php would be your login controller, which handles all login/logout logic.
    3) After a user has successfully logged in, you can redirect them to the index.php (or any page you want).

    Thus, you will have two separate controllers: main controller (responsible for index page) and login controller, responsible for logging in / logging out. login.tpl file in this case would be only a template containing some html and probably Smarty tags to render the login form.

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

Sidebar

Related Questions

Hey, I've been writing a program (a sort of e-Book viewing type thing) and
Hey guys..this is kind of a weird question but I'm making a webapp in
Hey, i need some help with rails, again ! Last it was about Authlogic..
Hey guys, I'm researching something for a friend of mine who's involved in road
Hey, all. Working on my first Rails app. I've searched all around - read
The application we have takes large amount of data most of which is called
Try the following on MSSQL 2005: select convert(char(2), 123) The key here is that
What's the best way to handle an expired password in an ASP.NET MVC application?
Currently I am making some decisions for my first objective-c API. Nothing big, just
I have a website that I made and I am planning to redo it.

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.