{"id":18725945,"url":"https://github.com/homescriptone/formulus","last_synced_at":"2025-08-31T21:32:16.846Z","repository":{"id":114770980,"uuid":"381479268","full_name":"homescriptone/formulus","owner":"homescriptone","description":"A library to generate fields into WordPress \u0026 frameworks apps.","archived":false,"fork":false,"pushed_at":"2022-11-16T19:06:25.000Z","size":38,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-23T04:08:15.475Z","etag":null,"topics":["laravel","symfony","wordpress","wordpress-plugin","wordpress-theme"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/homescriptone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://buymeacoffee.com/homescriptone"]}},"created_at":"2021-06-29T19:44:47.000Z","updated_at":"2024-08-08T12:34:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"1a23eb96-ca57-4f0a-8b5c-da48f2f48dff","html_url":"https://github.com/homescriptone/formulus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homescriptone%2Fformulus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homescriptone%2Fformulus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homescriptone%2Fformulus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homescriptone%2Fformulus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/homescriptone","download_url":"https://codeload.github.com/homescriptone/formulus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231629273,"owners_count":18402878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","symfony","wordpress","wordpress-plugin","wordpress-theme"],"created_at":"2024-11-07T14:12:34.896Z","updated_at":"2024-12-28T13:22:30.080Z","avatar_url":"https://github.com/homescriptone.png","language":"PHP","funding_links":["https://buymeacoffee.com/homescriptone"],"categories":[],"sub_categories":[],"readme":"# Formulus [![Twitter](https://img.shields.io/twitter/url?style=social\u0026url=https%3A%2F%2Fgithub.com%2Fhomescriptone%2FFormulus)](https://twitter.com/intent/tweet?text=Wow:\u0026url=https%3A%2F%2Fgithub.com%2Fhomescriptone%2FFormulus)\n\n![GitHub License](https://img.shields.io/github/license/homescriptone/formulus)\n[![GitHub stars](https://img.shields.io/github/stars/homescriptone/formulus?style=social)](https://github.com/homescriptone/formulus)\n[![GitHub followers](https://img.shields.io/github/followers/homescriptone?label=Follow\u0026style=social)](https://github.com/Rishit-dagli)\n\n\n\nThis repo implements [WooCommerce Form Fields](https://github.com/woocommerce/woocommerce) from \nWooCommerce. **Formulus** is a extended version of the WooCommerce library with the ability to use it into a WordPress plugin, themes or a simple PHP codebase.  \nBy using this library, you no longer need to write HTML code, let Formulus generate HTML fields for your application and focus more on usability.  \nHe is used into the WooCommerce plugin : [Ultimate SMS \u0026 WhatsApp for WooCommerce](https://wordpress.org/plugins/ultimate-sms-notifications/)\n## Installation\nYou just need to load it into your PHP codebase.\n\n```php\nrequire_once __DIR__. 'formulus.php';\n```\n\n## Usage\nThe library is composed of 3 fundamental functions:\n\n\n### 1 - formulus_input_fields( $key, $args, $value ) \nBased on the parameters passed, this function generate html code. ( Works only with WordPress, ClassicPress, BedRocks )\n\n* **$key ( string )**   : unique identifier to target this field,\n* **$args ( array )**   : list of options defining the type of fields you're creating,\n* **$value ( string )** : default value for the field \n\nThe parameter **$args** has this architecture : \n```php\n$args = array(\n  'type' =\u003e 'text' | 'select' | 'radio' | 'number' // specify type of the field, it support all HTML input type\n  'label'             =\u003e '', // specify a field label\n  'description'       =\u003e '', // specify a description for the field\n  'placeholder'       =\u003e '', // specify a placeholder\n  'maxlength'         =\u003e false, // specify the maxlength\n  'required'          =\u003e false, // whether this field is required or not\n  'autocomplete'      =\u003e false, // autocomplete or not\n  'class'             =\u003e array(), // contains the class to apply to the whole field\n  'label_class'       =\u003e array(), // contains the class for the label\n  'input_class'       =\u003e array(), // contains the class for the input\n  'return'            =\u003e false, // whether the field must be displayed directly or returned as HTML code\n  'options'           =\u003e array(), // options for the type select\n  'custom_attributes' =\u003e array(), // specify the data-attribute here or any custom attribute you would like to add\n  'default'           =\u003e '', // specify the default value for the field\n);\n```\n\n\n### 2 - formulus_input_table( $key, $args ) \nBased on the parameters passed, this function render fields one after another using a table structure. ( Works with WordPress, ClassicPress, BedRocks, Laravel, Symfony )\n\n* **$key ( string )**   : unique identifier to target this table,\n* **$args ( array )**   : list of options defining the type of fields you're creating,\n\nThe parameter **$args** has this architecture :\n```php\n$args = array(\n\t'product' =\u003e array( // specify the key for identifying this field\n\t\t'label' ,  // field label    =\u003e __( 'Title :' ),\n\t\t'label_class' =\u003e 'table-label', // class for the field label\n\t\t'description' =\u003e __( 'Title to show on top of the configurator.', ), // description for the field\n\t\t'content'     =\u003e '', // specify the HTML code to render for this field ,\n\t\t'tr_class'    =\u003e 'products-settings-description', // class to attribute the tr\n\t),\n  ...$args, // add more fields by following the previous code architecture,\n);\n```\nHere is a exemple of table generated with this function : \n\n\u003cimg width=\"907\" alt=\"image\" src=\"https://user-images.githubusercontent.com/25031292/194818077-31b6a80f-41c6-433f-b447-1c0a7b50de38.png\"\u003e\n\n\n### 3 - formulus_format_fields( $html_field ) \nBased on the HTML code passed, this function format and escape it.\n* **$html_field ( string )**   : HTML code to be displayed.\n\n\n\n## Want to Contribute 🙋‍♂️?\n\nAwesome! If you want to contribute to this project, you're always welcome!. You can take a look at [open issues](https://github.com/homescriptone/formulus/issues) for getting more information about current or upcoming tasks.\n\n## Want to discuss? 💬\n\nHave any questions, doubts or want to present your opinions, views? You're always welcome. You can [start discussions](https://github.com/homescriptone/formulus/discussions).\n\n## License\n\n```\nCopyright (C) 2022  HomeScript\nLicensed under GPL version 3,\nThis program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\nThis is free software, and you are welcome to redistribute it\nunder certain conditions; type `show c' for details.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhomescriptone%2Fformulus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhomescriptone%2Fformulus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhomescriptone%2Fformulus/lists"}