Understanding how to better communicate with other files in a component
Posted: Sat Oct 27, 2007 1:58 am
Hey guys,
I'm working on a basic component to upload CSV files for Joomla 1.0.
The idea as far as I understand Joomla component creation is to have a csv.php that calls for a function in csv.html.php that displays the upload form. This is working fine. However, the validation code I created requires a separated php file, let's call it validate.csv.php. But if I mention this file in the action="" part of the form field in csv.html.php Joomla does not recognize the file as a valid "MOS" and goes 403.
So, I'm wondering. Anyone knows what would be the best solution here? Should I put the validation code in csv.php? If so, how would I call it from csv.html.php? I'm fairly new to OOP and knowing when or how to call classes is still a bit of a mystery to me.
My idea is: show an upload form in the admin zone, where content is validated and then sent to the database. It works well as a stand-alone PHP project, but now I need to convert it to work in Joomla as a component. Ideally, I should have started right away coding it as a component and not as a normal PHP project, but I'm not yet capable of doing this.
Some sort of guidance at this stage is very welcome.
I'm working on a basic component to upload CSV files for Joomla 1.0.
The idea as far as I understand Joomla component creation is to have a csv.php that calls for a function in csv.html.php that displays the upload form. This is working fine. However, the validation code I created requires a separated php file, let's call it validate.csv.php. But if I mention this file in the action="" part of the form field in csv.html.php Joomla does not recognize the file as a valid "MOS" and goes 403.
So, I'm wondering. Anyone knows what would be the best solution here? Should I put the validation code in csv.php? If so, how would I call it from csv.html.php? I'm fairly new to OOP and knowing when or how to call classes is still a bit of a mystery to me.
My idea is: show an upload form in the admin zone, where content is validated and then sent to the database. It works well as a stand-alone PHP project, but now I need to convert it to work in Joomla as a component. Ideally, I should have started right away coding it as a component and not as a normal PHP project, but I'm not yet capable of doing this.
Some sort of guidance at this stage is very welcome.