![]() ![]() what do we have to ? You answer that automatically comes out of your head as you start to get used ^^ : we will first declare the model in config.xml of our magento module. To create a Model, you who have followed the three previous tutorials. ![]() You know, Magento uses the MVC model, we must create a model for interracting with our database. To make interractions between this table and magento, we will create the object named Model. `id_pfay_films` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , We will see later how to create this table automatically when magento detects your Magento module for the first time ( in the lesson "Commit, Rollback & Create a table in Magento" ) but for now we will do it simply. So we need to create a table in the database, we will call this pfay_films table. So we will create a table "film" (wich will be ouf db table for all our movies), so we want the block to display all the movie titles available like this: In this tutorial we will modify our module to use information in our database (in MySQL) and display it in our Block template. Now, a module that is the equivalent of an "echo" is not very helpful in real life and it's nothing very complicated you saw. I want to thank you for your very positive feedback that motivate me to continue this series of tutorials. Our module works well and I think you understand how it works so far. We previously created a module with a controller, a block and a template. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |