public function endpoints_table($endpoints, $issuerid) {
        global $CFG;

        $table = new html_table();
        $table->head  = [
            get_string('name'),
            get_string('url'),
            get_string('edit'),
        ];
        $table->attributes['class'] = 'admintable generaltable';
        $data = [];

        $index = 0;

        foreach ($endpoints as $endpoint) {
            // Name.
            $name = $endpoint->get('name');
            $namecell = new html_table_cell(s($name));
            $namecell->header = true;

            // Url.
            $url = $endpoint->get('url');
            $urlcell = new html_table_cell(s($url));

            $links = '';
            // Action links.
            $editparams = ['issuerid' => $issuerid, 'endpointid' => $endpoint->get('id'), 'action' => 'edit'];
            $editurl = new moodle_url('/admin/tool/oauth2/endpoints.php', $editparams);
            $editlink = html_writer::link($editurl, $this->pix_icon('t/edit', get_string('edit')));
            $links .= ' ' . $editlink;

            // Delete.
            $deleteparams = ['issuerid' => $issuerid, 'endpointid' => $endpoint->get('id'), 'action' => 'delete'];
            $deleteurl = new moodle_url('/admin/tool/oauth2/endpoints.php', $deleteparams);
            $deletelink = html_writer::link($deleteurl, $this->pix_icon('t/delete', get_string('delete')));
            $links .= ' ' . $deletelink;

            $editcell = new html_table_cell($links);

            $row = new html_table_row([
                $namecell,
                $urlcell,
                $editcell,
            ]);

            $data[] = $row;
            $index++;
        }
        $table->data = $data;
        return html_writer::table($table);
    }
public function endpoints_table($endpoints, $issuerid) {
        global $CFG;

        $table = new html_table();
        $table->head  = [
            get_string('name'),
            get_string('url'),
            get_string('edit'),
        ];
        $table->attributes['class'] = 'admintable generaltable';
        $data = [];

        $index = 0;

        foreach ($endpoints as $endpoint) {
            // Name.
            $name = $endpoint->get('name');
            $namecell = new html_table_cell(s($name));
            $namecell->header = true;

            // Url.
            $url = $endpoint->get('url');
            $urlcell = new html_table_cell(s($url));

            $links = '';
            // Action links.
            $editparams = ['issuerid' => $issuerid, 'endpointid' => $endpoint->get('id'), 'action' => 'edit'];
            $editurl = new moodle_url('/admin/tool/oauth2/endpoints.php', $editparams);
            $editlink = html_writer::link($editurl, $this->pix_icon('t/edit', get_string('edit')));
            $links .= ' ' . $editlink;

            // Delete.
            $deleteparams = ['issuerid' => $issuerid, 'endpointid' => $endpoint->get('id'), 'action' => 'delete'];
            $deleteurl = new moodle_url('/admin/tool/oauth2/endpoints.php', $deleteparams);
            $deletelink = html_writer::link($deleteurl, $this->pix_icon('t/delete', get_string('delete')));
            $links .= ' ' . $deletelink;

            $editcell = new html_table_cell($links);

            $row = new html_table_row([
                $namecell,
                $urlcell,
                $editcell,
            ]);

            $data[] = $row;
            $index++;
        }
        $table->data = $data;
        return html_writer::table($table);
    }
public function endpoints_table ( $ endpoints , $ issuerid ) { global $ CFG ; $ table = new html_table ( ) ; $ table -> head = [ get_string ( 'name' ) , get_string ( 'url' ) , get_string ( 'edit' ) , ] ; $ table -> attributes [ 'class' ] = 'admintable generaltable' ; $ data = [ ] ; $ index = 0 ; foreach ( $ endpoints as $ endpoint ) { // Name. $ name = $ endpoint -> get ( 'name' ) ; $ namecell = new html_table_cell ( s ( $ name ) ) ; $ namecell -> header = true ; // Url. $ url = $ endpoint -> get ( 'url' ) ; $ urlcell = new html_table_cell ( s ( $ url ) ) ; $ links = '' ; // Action links. $ editparams = [ 'issuerid' => $ issuerid , 'endpointid' => $ endpoint -> get ( 'id' ) , 'action' => 'edit' ] ; $ editurl = new moodle_url ( '/admin/tool/oauth2/endpoints.php' , $ editparams ) ; $ editlink = html_writer :: link ( $ editurl , $ this -> pix_icon ( 't/edit' , get_string ( 'edit' ) ) ) ; $ links .= ' ' . $ editlink ; // Delete. $ deleteparams = [ 'issuerid' => $ issuerid , 'endpointid' => $ endpoint -> get ( 'id' ) , 'action' => 'delete' ] ; $ deleteurl = new moodle_url ( '/admin/tool/oauth2/endpoints.php' , $ deleteparams ) ; $ deletelink = html_writer :: link ( $ deleteurl , $ this -> pix_icon ( 't/delete' , get_string ( 'delete' ) ) ) ; $ links .= ' ' . $ deletelink ; $ editcell = new html_table_cell ( $ links ) ; $ row = new html_table_row ( [ $ namecell , $ urlcell , $ editcell , ] ) ; $ data [ ] = $ row ; $ index ++ ; } $ table -> data = $ data ; return html_writer :: table ( $ table ) ; }
This function will render one beautiful table with all the endpoints.

@param \core\oauth2\endpoint[] $endpoints - list of all endpoints.
@param int $issuerid
@return string HTML to output.
This function will render one beautiful table with all the endpoints .