If I want to create my own hooks, where do i need to call them?
Let's say I want a hook that checks the database if the e.g. email that user typed, exists in db and if it exist, redirect him to another page.
I will create the function in the func.php file. I can undestand this.
What do I need to do to show the user a form to input his email for example?
Some code in the design\themes\MY_THEME\templates\addons in .tpl file?
You do not have to use only hooks. You can also create your own controllers or post/pre controllers.
What do I need to do to show the user a form to input his email for example?
You can create the controller if there is new page, for example, app/addons/my_changes/controllers/frontend/custom_form.php, then create the template for this controller: design/themes/YOUR_THEME/templates/addons/my_changes/views/custom_form/MODE.tpl, where you will place the form for the e-mail.
If you want to add the form to the existing page, then you need to use pre/post controllers and hooks in templates.
You can find many examples of the default add-ons and examine how they work. Just start to create your add-on and you will understand how it works. Of course, we will help you.
You do not have to use only hooks. You can also create your own controllers or post/pre controllers.
You can create the controller if there is new page, for example, app/addons/my_changes/controllers/frontend/custom_form.php, then create the template for this controller: design/themes/YOUR_THEME/templates/addons/my_changes/views/custom_form/MODE.tpl, where you will place the form for the e-mail.
If you want to add the form to the existing page, then you need to use pre/post controllers and hooks in templates.
You can find many examples of the default add-ons and examine how they work. Just start to create your add-on and you will understand how it works. Of course, we will help you.
Thank you very much Oleg.
I am thinking of creating a new login page for my user but because I want to make the login process in two steps,
First Step:
user gives email, I check
1) if it exists and if not, I want to redirect him again to input a valid email address for example,
Second Step:
1) if it exists only one time, so I ask him for the password and
2) if it exists more than one time, so I ask him to pick a "user" and to type the password.
I want to make it as an addon in order to leave the core code intact.
So, if I understood well what you said, I must create app/addons/my_changes/init.php and app/addons/my_changes/func.php
One question here is, is it possible to not declare any hook on init.php and func.php?
I ask this because you said that I can use controllers.
So if I am going to create controllers, I have to create a app/addons/my_changes/frontend/controllers/custom_form.php in which I will have my "modes" to specify what the form must do in every form.
And then, I have to create a design/themes/MY_THEME/templates/addons/my_changes/views/custom_form/MODE.tpl
in which I have to write the form that asks for the email as you said.
and now, if I go to "localhost/eshop/index.php?dispatch=my_changes.my_info " I get a page with a text area for my user to fill in with his/her email and a button which for now does not working but I'm happy I have managed something today :)