Skip to content

Commit

Permalink
Note about name regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Corbin committed Apr 28, 2021
1 parent ac7319c commit 742cd52
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Input.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ public function __construct($form = null, $type = 'text', $id = null, $name = nu
* hide-value: for when the form would access the form by defaultl but you dont want it to. Currently only affective for textarea, and normal input types
*/
}

/**
* If the name is passed directly, we will need to check it is not an array,
* and if it is, get the basename
*
* TODO use "/.*(?<!\\)\[(.+?)(?<!\\)\]/" to get last
*
* @param string|null $name
*/
public static function strip_name($name){
$start = strrpos($name, '[',);
if ($start === false){
Expand Down

0 comments on commit 742cd52

Please sign in to comment.