PHP code example of alt3 / cakephp-validation-exposer
1. Go to this page and download the library: Download alt3/cakephp-validation-exposer library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
alt3 / cakephp-validation-exposer example snippets
use Alt3\ValidationExposer\Lib\ValidationExposer;
class SystemController extends AppController
{
public function validationInfo()
{
$validationExposer = new ValidationExposer([
'excludedTables' => [
'table_to_skip' // this table will not be processed
],
'hiddenRuleParts' =>
'message' // do not show this part inside the `rules` array
]
]);
$this->set([
'success' => true,
'data' => $validationExposer->rules(),
'_serialize' => ['success', 'data']
]);
}
}