Hello dear community,
Im working on an interesting project posting some new questions.
First, is there a « SPIP » way to register a route? E.g. if I want to have a pretty URl /somepage, and I want a php file to evaluate it, is there a function I can call like
new_route(« Url », function)
to evaluate it? If not, I would use htaccess, but I was wondering if SPIP can already do this.
Secondly, I’m struggling to create a formulaire for uploading images to my SPIP site.
For articles this is easy, for example simply take the $_POST[‹ title ›] variable and execute
article_inserer( $id_rubrique , array(« titre » => $_POST[‹ title ›] );
But for documents, how do I process a file? I can access the file with $_POST[‹ file ›]
But I find the
ajouter_documents($id_document, $files, $objet, $id_objet, $mode);
function does not take the $_POST[‹ file ›] variable but expects an array created by function
$files = joindre_trouver_fichier_envoye();
However, I struggle to create a form that complies with this function. Is there a simple way?
Thanks,
Urs