简体   繁体   中英

How to show another php files other than Drupal8

Thank you for looking at my question.

I have a website created by Drupal8. And I want to put contact form made in PHP instead of Drupal webform.

I placed the files like this.

DocumentRoot/
|- core/
|- sites/
|- themes/
etc.
|- myform/
     |- index.php

And I sat permissions to "myform" and "index.php" like this,

chmod 775 DocumentRoot/myform
chmod 664 DocumentRoot/myform/index.php

But It returns 403 Error when I accessed "hxxps://example.com/myform/".

What should I do? If you have any ideas, please tell me how to read php files other than Drupal.

Drupal wants you to create new routes 'The Drupal Way' - in your case you could create a custom module. This contains your MyForm.php that extends Drupal\Core\Form\FormBase . Then you add a routing file to tell drupal about your new path.

This tutorial is a couple years old, but should lead you in the right direction: http://karimboudjema.com/en/drupal/20181013/create-custom-form-form-api-drupal-8

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM