Skip to content

Commit

Permalink
Merge pull request #36 from nliautaud/pico-2.0
Browse files Browse the repository at this point in the history
Pico 2.0 support
  • Loading branch information
nliautaud authored Jul 4, 2018
2 parents a380a30 + 1df0e13 commit 1876bc4
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions p01-contact/PicoContact.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* This plugin let you add contact forms in your pages by writing simple tags.
* You can also define recipients or create your own complex forms.
*
* This file is the handle of p01-contact for Pico CMS.
* This file is the handle of p01-contact for Pico 2.
*
* @link https://github.com/nliautaud/p01contact
* @author Nicolas Liautaud
Expand All @@ -17,6 +17,8 @@

class PicoContact extends AbstractPicoPlugin
{
const API_VERSION = 2;

private $P01contact;

/**
Expand Down Expand Up @@ -67,17 +69,14 @@ public function onContentPrepared(&$content)
/**
* Add {{ contact() }} and {{ contact_admin() }} twig functions
* For outputing forms and admin panels from themes templates
*
* Triggered when Pico registers the twig template engine
*
* Triggered before Pico renders the page
*
* @see Pico::getTwig()
* @see DummyPlugin::onPageRendered()
* @param Twig_Environment &$twig twig template engine
* @param array &$twigVariables template variables
* @param string &$templateName file name of the template
* @see Pico::getTwig()
* @param Twig_Environment &$twig Twig instance
* @return void
*/
public function onPageRendering(Twig_Environment &$twig, array &$twigVariables, &$templateName)
public function onTwigRegistered(Twig_Environment &$twig)
{
// {{ contact() }} output the default form
// {{ contact('parameters') }} custom parameters
Expand Down

0 comments on commit 1876bc4

Please sign in to comment.