How to go from add_submenu_page to another page

hello everyone i’m going from procedural php to objects, i was asking myself a question, once i created my plugin that gives me the possibility to have in the wp dashboard a quick view of a section through add_menu_page, and created sub-items add_submenu_page, I am inside this page,

function secondo_menu_sottomenu(){     echo '<div class="wrap"><div id="icon-options-general" class="icon32"><br></div>         <h2>PRIMO SOTTOMENÙ</h2></div>                  <!--Card--> <div id="test" class="card card-cascade narrower mb-4" style="margin-top: 28px;cursor: pointer;">     <!--Card image-->     <div class="view view-cascade">          <a>             <div class="mask rgba-white-slight"></div>         </a>     </div>     <!--/.Card image-->     <!--Card content-->     <div class="card-body card-body-cascade">         <h5 style="font-weight: 500;font-size: 17px;">             TEST         </h5>         <small>N° TEST</small>     </div>     <!--/.Card content--> </div> <!--/.Card--> <script type="text/javascript">     document.getElementById("test").setAttribute(\'onclick\', \'location.href = "test.php"\'); </script>         '; } 

now I would like to go to a page called test.php, but how do I create it?

I mean imagine you have the dashboard page, then the users section, and inside users, I want to create a page called registered users and see all registered users, this is what I want to explain.

in procedural I would have created:

home.php user.php

and in user.php a link to alluser.php

how do I create the test.php is there an add_page-like instruction?

add_submenu_page returns null

After creating a parent admin menu item, which works fine, I fail to add a submenu page. Trying to var_dump the return value of add_submenu_page() I get ‘null’.

My functions are:

    /**      * Register the admin menu page      *       * @since   1.0.0      */     public function add_admin_menu() {         add_menu_page( 'WPQuotes', 'WPQuotes', 'manage_options', 'wp-quotes-plugin', 'wpq_admin_settings_page_main', 'dashicons-networking' );         add_submenu_page( 'wp-quotes-plugin', 'New WPQ Form', 'New WPQ Form', 'manage-options', 'wpq-new-form', 'wpq_admin_settings_page_new_form');     }      public function run_all(){         add_action( 'admin_menu', array($  this, 'add_admin_menu'), 10 );     }