Created
January 30, 2018 14:01
-
-
Save h3nn3s/b22a0e0275dc9cb4f5f77aac44a759ce to your computer and use it in GitHub Desktop.
TYPO3 Powermail Validator Class
This file contains 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
plugin.tx_powermail.settings.setup { | |
validation { | |
customValidation { | |
100 = Multivisio\MvMultilindDe\Domain\Validator\PznValidator | |
} | |
} | |
} |
This file contains 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 | |
namespace HenrikZiegenhain\MyExt\Domain\Validator; | |
/*************************************************************** | |
* Copyright notice | |
* | |
* (c) 2018 Henrik Ziegenhain <[email protected]> | |
* | |
* All rights reserved | |
* | |
* This script is part of the TYPO3 project. The TYPO3 project is | |
* free software; you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation; either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* The GNU General Public License can be found at | |
* http://www.gnu.org/copyleft/gpl.html. | |
* | |
* This script is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
* GNU General Public License for more details. | |
* | |
* This copyright notice MUST APPEAR in all copies of the script! | |
***************************************************************/ | |
use TYPO3\CMS\Core\Utility\GeneralUtility; | |
class PznValidator | |
{ | |
/** | |
* Check if given string is in list of elements | |
* | |
* @param string $value | |
* @param string $validationConfiguration | |
* @return bool | |
*/ | |
public function validate100($value, $validationConfiguration) | |
{ | |
if (GeneralUtility::inList($validationConfiguration, $value)) { | |
return TRUE; | |
} | |
return FALSE; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment