Created
March 6, 2017 14:59
-
-
Save adamjakab/d5a88b1ae6d006ddaf27790673410aad to your computer and use it in GitHub Desktop.
form #submit with static class method reference
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by Adam Jakab. | |
* Date: 06/03/17 | |
* Time: 12.43 | |
*/ | |
namespace Agora\Alter\Form\Id; | |
use Mekit\Drupal7\HookInterface; | |
class UserProfileForm implements HookInterface | |
{ | |
/** | |
* @param array $form | |
* @param array $form_state | |
*/ | |
public static function execute(&$form, &$form_state) | |
{ | |
$form['#submit'][] = ['\Agora\Alter\Form\Id\UserProfileForm', 'customSubmit']; | |
} | |
public static function customSubmit($form, &$form_state) | |
{ | |
drupal_goto(url('<front>')); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment