LMSouq
general-dev Open

How do I create a simple 'Hello World' module in Magento?

AL
Ali
1 month ago
3 views
Problem Description
How can the following be accomplished in Magento? - Display a "Hello World" message using a controller/view/model approach. So, if I went to `http://example.com/myController` it would show the string 'Hello World'. Being able to show this string within the template of my website (for example, the header, footer, etc.) will be a bonus. - How do I add a method to this controller (or a new controller if necessary), which interacts with a model, and performs the query `Select * FROM articles where id='10'` and returns the row (containing the columns `id, title, content`) to the controller? And then use the controller to include a view, which would display this row. So going to `http://example.com/myController/show_row` (or something similar) would display the row within a view. (No need to be fancy, just a `echo $row->id;` or something similar would work.) Any other information about Magento's code structure will also be very helpful.

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base