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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:28:13+00:00 2026-05-26T13:28:13+00:00

In magento I have started to set up an admin module and am not

  • 0

In magento I have started to set up an admin module and am not using layout XML but rather just the indexController to load my phtml.

 public function indexAction()
 {
   $this->loadLayout();
   $this->_addContent($this->getLayout()->createBlock('adminhtml/template')->setTemplate('module/page1.phtml'));
   // ...

From that phtml file I need to query another php file but I don’t understand how I can add another file and what the path would be to page2.phtml ? So I just need a home for this other php file. It can really be anywhere on the server.

For example from my index I am loading a script that runs Ajax on another php file. How can I add that somewhere inside the module and what would the url be to it. This whole controller business has me pretty confused. I am tired and hoping to wake up to a bounty of stack overflow wisdom. My apologies if this question is not very clear. I will edit tomorrow after some coffee if need be.

  • 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-26T13:28:13+00:00Added an answer on May 26, 2026 at 1:28 pm

    In Magento, URLs are not paths to phtml files (which are just templates), they are paths to controllers and actions. A URL is comprised of the “frontname” (a reference to the module), then the controller, then the action. The partial code you’ve shown is the index action (the default action) for your controller. The target of your Ajax call will be another action probably in the same controller. That action can then use the technique you’ve used above to load the appropriate template phtml file (page2.phtml).

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

Sidebar

Related Questions

I have Magento set up to not display VAT on checkout, but it is
I have a custom module I made for Magento. From the admin, there is
In my magento project the search result not displays. I have customized my magento.
I've just installed Magento on my website, but I can't access the backend. The
I am just starting out with Magento and have two requirements for a private
I have a Magento site using JS (prototype) to display tabbed content on product
in magento configuration i have set shipping to be £5. Is there a way
I've recently started using Magento for a client's webshop, and still need to get
I need to upgrade my server to PHP 5.3 but have a Magento install
I have written a Magento module to listen for the OrderSave event and perform

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.