PHPackages                             emildev/simpleform2b - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. emildev/simpleform2b

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

emildev/simpleform2b
====================

Create simple forms directly in your controller. Supports all input-types, textarea and submit

v2.0(10y ago)022PHPPHP &gt;=5.3.0

Since Oct 17Pushed 10y ago1 watchersCompare

[ Source](https://github.com/emilwallgren/SimpleForm2B)[ Packagist](https://packagist.org/packages/emildev/simpleform2b)[ RSS](/packages/emildev-simpleform2b/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

[![Build Status](https://camo.githubusercontent.com/6ab4e8eb0fef83f1b2a6a1404c690090ad9ad77f73a544cd2f04923e28ac57d0/68747470733a2f2f7472617669732d63692e6f72672f656d696c77616c6c6772656e2f53696d706c65466f726d32422e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/emilwallgren/SimpleForm2B) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/db0665c24a75f0c2af3e7aaf06472592b325fcfde4d68ff0b16c5ca93b4be9de/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f656d696c77616c6c6772656e2f53696d706c65466f726d32422f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/emilwallgren/SimpleForm2B/?branch=master) [![Code Coverage](https://camo.githubusercontent.com/8e737c5c322703bc2443d205379d8c4065cc4c4816230094484a765793e37a91/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f656d696c77616c6c6772656e2f53696d706c65466f726d32422f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/emilwallgren/SimpleForm2B/?branch=master)

SimpleForm2B - README
=====================

[](#simpleform2b---readme)

A simple form-creator for Anax MVC built with php. Supports all input-types, textarea and submit.

Installation
------------

[](#installation)

Download package from packagist using

`composer require emildev/simpleform2b`

from your console. When this is done, you can enter your vendor folder and navigate to emildev/simpleform2b. Inside you will find two folders, src and webroot. Inside the src is the main module, leave it there. If you head over to webroot, you will find a folder named simpleform2b. copy that folder and put it in your views directory.

Usage - creating the SimpleForm2B object
----------------------------------------

[](#usage---creating-the-simpleform2b-object)

Now that the package is properly installed, you can start to use the module. To include the module in your controller, simply create an object with the following reference.

```
\emildev\SimpleForm2B\SimpleForm2B();
```

An example where I create an $auth object that contains the SimpleForm2B module would hence look like this:

```
$auth = new \emildev\SimpleForm2B\SimpleForm2B();
```

Usage - using the the SimpleForm2B object
-----------------------------------------

[](#usage---using-the-the-simpleform2b-object)

SimpleForm2B contains 5 different methods.

- setForm()
- setInput()
- setTextArea()
- setSubmit()
- saveForm()

How to use them is explained below

### setForm()

[](#setform)

setForm() opens the form and contains 3 parameters:

1. Method
2. Action
3. Class

These three parameters are not optional and should always be set before using other methods. An example where I create a new form with the method of post, the action of url:register/check and the class of registerForm should hence look like this:

```
$auth->setForm('post', $this->url->create('register/check'), 'registerForm');
```

### setInput()

[](#setinput)

setInput() creates an input type and contains 6 parameters:

1. type
2. name
3. value - optional
4. id - optional
5. label - optional
6. placeholder - optional

If you choose not to use a parameter, define NULL in it's place. You can create how many input-fields you want. They will show up in the order you write them in the controller. An example where I create an input-field with the type of text, name of username, no-value, id of username, label of Insert Username and no-placeholder would look like this:

```
$auth->setInput('text', 'username', NULL, 'username', 'Insert Username', NULL);
```

### setTextArea()

[](#settextarea)

setTextArea() creates a textarea for your form. It consists of 5 parameters:

1. name
2. value - optional
3. id - optional
4. label - optional
5. placeholder - optional

If you choose not to use a parameter, define NULL in it's place. You can only create one textarea for each form, and it will always end up under the input-fields. An example where I create a textarea with the name of textarea, no-value, no-id, label of Write info and no-placeholder would look like this:

```
$auth->setTextArea('textarea', NULL, NULL, 'Write info', NULL);
```

### setSubmit()

[](#setsubmit)

setSubmit() creates a submit-button at the bottom of your form. It has 2 non-optional parameters:

1. name
2. value

This method is quite self-explanatory but if you want to create a submit button which contains the name of submitThis and a value of Send, this is how you write it in your controller:

```
$auth->setSubmit('submitThis', 'Send');
```

### saveForm()

[](#saveform)

saveForm() should always be included after all other methods are set. It contains 0 parameters and offers you a way to save the form into a variable which you can pass along to the view. An example of saving the form into the variable $myNewForm would look like this:

```
$myNewForm = $auth->saveForm();
```

When passing along the variable to the view, it should always be named 'form'. An example on how to implement this into Anax-Mvc would be:

```
$this->views->add('simpleform2b/simpleform2b', [
				'form' => $myNewForm
				]);
```

Finally
-------

[](#finally)

With SimpleForm2B, you can easily create forms in lightning speed. The above information should be everything you need to know. If you still end up with problems, you are free to contact me at

Have Fun!

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~7 days

Total

2

Last Release

3859d ago

Major Versions

v1.0 → v2.02015-10-24

### Community

Maintainers

![](https://www.gravatar.com/avatar/34ef832e1b02eaf7cbbddc42a729d86955ac4bfc6fbccbb45267a51f6819da36?d=identicon)[emilwallgren](/maintainers/emilwallgren)

---

Top Contributors

[![emilwallgren](https://avatars.githubusercontent.com/u/11517947?v=4)](https://github.com/emilwallgren "emilwallgren (30 commits)")

### Embed Badge

![Health badge](/badges/emildev-simpleform2b/health.svg)

```
[![Health](https://phpackages.com/badges/emildev-simpleform2b/health.svg)](https://phpackages.com/packages/emildev-simpleform2b)
```

###  Alternatives

[t3kit/t3kit

t3kit project. A TYPO3 website starterkit.

5624.3k](/packages/t3kit-t3kit)[welp/ical-bundle

Symfony Bundle to manage .ics iCal file (creating and eventually reading)

10114.3k](/packages/welp-ical-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
