(Grav GitSync) Automatic Commit from smokephil
This commit is contained in:
commit
4267db646d
2765 changed files with 462171 additions and 0 deletions
38
plugins/form/classes/FormFactory.php
Normal file
38
plugins/form/classes/FormFactory.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Grav\Plugin\Form;
|
||||
|
||||
use Grav\Common\Page\Interfaces\PageInterface;
|
||||
use Grav\Common\Page\Page;
|
||||
use Grav\Framework\Form\Interfaces\FormFactoryInterface;
|
||||
use Grav\Framework\Form\Interfaces\FormInterface;
|
||||
|
||||
class FormFactory implements FormFactoryInterface
|
||||
{
|
||||
/**
|
||||
* Create form using the header of the page.
|
||||
*
|
||||
* @param Page $page
|
||||
* @param string $name
|
||||
* @param array $form
|
||||
* @return Form|null
|
||||
* @deprecated 1.6 Use FormFactory::createFormByPage() instead.
|
||||
*/
|
||||
public function createPageForm(Page $page, string $name, array $form): ?FormInterface
|
||||
{
|
||||
return new Form($page, $name, $form);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create form using the header of the page.
|
||||
*
|
||||
* @param PageInterface $page
|
||||
* @param string $name
|
||||
* @param array $form
|
||||
* @return Form|null
|
||||
*/
|
||||
public function createFormForPage(PageInterface $page, string $name, array $form): ?FormInterface
|
||||
{
|
||||
return new Form($page, $name, $form);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue