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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:52:56+00:00 2026-06-17T21:52:56+00:00

I’ve researched about the Front Controller pattern. I’m convinced I’m going to use that

  • 0

I’ve researched about the Front Controller pattern. I’m convinced I’m going to use that pattern for an upcoming project. I have no code written yet, but, how do I use presentation logic for my websites? What if I want to display certain information when the user is logged in and when the user has certain rights? What if a certain form needs data from the database in order to work? (For the latter I was thinking to call the corresponding controller with AJAX and loading the data this way but I don’t know if there’s a more efficient way) This leaves me a bit confusing, and I want to avoid if possible to use frameworks like Smarty or CakePHP. Thank you beforehand.

EDIT: I was thinking about using a template controller class, this is, a class whose responsability would be to load certain webpages and display them, called from the front controller. My main issue is with loading data from the database when the template page gets called. What if there’s a form that needs data from the database? Do I have to rely on AJAX to load the data, or is there a way to tell a template to load data while keeping the layers separated?

  • 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-06-17T21:52:58+00:00Added an answer on June 17, 2026 at 9:52 pm

    I think I got an answer. I haven’t tested this yet but I think I can do it this way.

    First, HTML5 has the capability to add custom data attributes to each tag. With that in mind, I can do the following, given we have a targetController class with a method named foo() and a front controller that appends the word “Controller” to every request:

    <select data-target="target" data-action="foo">
    </select>
    

    This way I can call a certain controller and invoke a certain action before the document gets rendered! Now, instead of just including a template the regular way, I can load them through a DOM library that will delegate the controller loading to either the front controller as a regular request or through a class that might do the controller loading. This way I don’t have to rely on javascript to do anything. I will definitely test this solution once I get to start working!

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

Sidebar

Related Questions

I have a small JavaScript validation script that validates inputs based on Regex. I
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I don't have much knowledge about the IPv6 protocol, so sorry if the question
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.