Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/log1x/sage-html-forms
Create forms using HTMLForms.io and Sage 10 Blade components
https://github.com/log1x/sage-html-forms
blade htmlforms sage10 wordpress
Last synced: about 2 months ago
JSON representation
Create forms using HTMLForms.io and Sage 10 Blade components
- Host: GitHub
- URL: https://github.com/log1x/sage-html-forms
- Owner: Log1x
- License: mit
- Created: 2020-05-17T05:17:28.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-11-16T23:51:51.000Z (about 1 year ago)
- Last Synced: 2024-10-04T12:13:56.860Z (3 months ago)
- Topics: blade, htmlforms, sage10, wordpress
- Language: PHP
- Homepage: https://github.com/log1x/sage-html-forms
- Size: 21.5 KB
- Stars: 51
- Watchers: 5
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# Sage HTML Forms
![Latest Stable Version](https://img.shields.io/packagist/v/log1x/sage-html-forms?style=flat-square)
![Total Downloads](https://img.shields.io/packagist/dt/log1x/sage-html-forms?style=flat-square)
![Build Status](https://img.shields.io/github/actions/workflow/status/log1x/sage-html-forms/main.yml?branch=master&style=flat-square)This is a simple package for the [HTML Forms](https://wordpress.org/plugins/html-forms/) plugin that allows you to easily render forms using a corresponding Blade view (if one is present) with Sage 10.
A few additional opinionated tweaks include:
- Moving the HTML Forms admin menu item to the Options submenu.
- Hide the ads shown in the sidebar of the admin page.## Requirements
- [Sage](https://github.com/roots/sage) >= 10.0
- [HTML Forms](https://wordpress.org/plugins/html-forms/)
- [PHP](https://secure.php.net/manual/en/install.php) >= 7.3
- [Composer](https://getcomposer.org/download/)## Installation
Install via Composer:
```bash
$ composer require log1x/sage-html-forms
```## Usage
### Getting Started
Start by creating a form in the HTML Forms admin menu page if you do not already have one.
You can leave the "Form code" blank as it will not be used if a corresponding Blade view exists.
### Creating a View
Once your form is created, simply generate a view using the slug assigned to your form:
```bash
$ wp acorn make:form contact-us
```You will find the generated form view in `resources/views/forms/contact-us.blade.php` containing a simple form component:
```php
```
When HTML Forms processes "Form Actions" – it simply fetches each input name to create the usable variables.
That being said, the default view would provide `[NAME]` and `[EMAILADDRESS]`.
#### Error Messages
Outside of defining your error messages on the options page, you can optionally provide them to the `` component directly:
```php
```
### Prevent moving Dashboard menu item
By default the HTML Forms menu items is moved to the Options submenu. Prevent that by using the `hf_hide_admin_menu` hook:
```php
add_filter('hf_hide_admin_menu', '__return_false');
```## Bug Reports
If you discover a bug in Sage HTML Forms, please [open an issue](https://github.com/log1x/sage-html-forms/issues).
## Contributing
Contributing whether it be through PRs, reporting an issue, or suggesting an idea is encouraged and appreciated.
## License
Sage HTML Forms is provided under the [MIT License](https://github.com/log1x/sage-html-forms/blob/master/LICENSE.md).