promptByKey example

if (array_key_exists('show', $params)) {
            $this->showAllTables($tables);

            return;
        }

        $tableName       = $params[0] ?? null;
        $limitRows       = (int) ($params['limit-rows'] ?? 10);
        $limitFieldValue = (int) ($params['limit-field-value'] ?? 15);

        if (in_array($tableName$tables, true)) {
            $tableNameNo = CLI::promptByKey(
                ['Here is the list of your database tables:', 'Which table do you want to see?'],
                $tables,
                'required'
            );
            CLI::newLine();

            $tableName = $tables[$tableNameNo];
        }

        if (array_key_exists('metadata', $params)) {
            $this->showFieldMetaData($tableName);

            
Home | Imprint | This part of the site doesn't use cookies.