About method not Exist:think\db\query->render error resolution

Source: Internet
Author: User
Tags getmessage

{volist name= "Teachers" id= "Teachers" key= "key"}<TR>                    <TD>{$key}</TD>                <TD>{$Teachers->getdata (' name ')}</TD>                <TD>{eq name= ' $Teachers->getdata ("Sex") ' value= ' 0 '} male {else/} female {/eq}</TD>                <TD>{$Teachers->getdata (' email ')}</TD>                <TD>{$Teachers->getdata (' username ')}</TD>                <TD><ahref= "{: URL (' edit?id= '. $Teachers->getdata (' id ')}">Edit&nbsp;&nbsp;</a>                <ahref= "{: URL (' delete?id= '. $Teachers->getdata (' id ')}">Delete</a></TD>            </TR>{/volist}</Table>current total number of pages {$Teachers->count ()} {$Teachers->render ()}</Div>

Html

 Public functionindex () {Try{        $pagesize= 10; $Teacher=NewTeacher; //$Teachers = $Teacher->select ();        $Teachers=$Teacher->paginate ($pagesize); //$teacher = $Teachers [0];        Var_dump ($teacher->getdata ());        echo ' <br/> ';        echo $teacher->getdata (' name ');        echo ' <br/> '; return $teacher->getdata (' name ');        $this->assign (' Teachers ',$Teachers);//Pass data like a view//retrieve packaged data        $htmls=$this-fetch (); //returning data to a user        return $htmls; }Catch(\think\Exception\httpresponseexception$e){            Throw $e; }Catch(\Exception $e){            return $e-GetMessage (); }        }

Php

At first, it was the way it was.

Solution:

 <Divclass= "Col-md-12">            <HR/>            <ahref= "{: URL (' Add ')}"class= "Btn btn-primary"><Iclass= "Glyphicon glyphicon-plus"></I>&nbsp;Increase</a>            <HR/>            <Tableclass= "Table Table-hover table-bordered">                <TRclass= "Info">                    <th>Serial number</th>                    <th>Name</th>                    <th>Gender</th>                    <th>Mailbox</th>                    <th>User name</th>                    <th>Operation</th>                </TR>{volist name= "Teachers" id= "Teachers" key= "key"}<TR>                    <TD>{$key}</TD>                <TD>{$Teachers->getdata (' name ')}</TD>                <TD>{eq name= ' $Teachers->getdata ("Sex") ' value= ' 0 '} male {else/} female {/eq}</TD>                <TD>{$Teachers->getdata (' email ')}</TD>                <TD>{$Teachers->getdata (' username ')}</TD>                <TD><ahref= "{: URL (' edit?id= '. $Teachers->getdata (' id ')}">Edit&nbsp;&nbsp;</a>                <ahref= "{: URL (' delete?id= '. $Teachers->getdata (' id ')}">Delete</a></TD>            </TR>{/volist}</Table>current total number of pages {$Teachers->count ()} {$page}</Div>

Php

 Public functionindex () {Try{        $pagesize= 10; $Teacher=NewTeacher; //$Teachers = $Teacher->select ();        $Teachers=$Teacher->paginate ($pagesize); $page=$Teachers-render ();
Call the render () method newly added here//$teacher = $Teachers [0]; Var_dump ($teacher->getdata ()); echo ' <br/> '; echo $teacher->getdata (' name '); echo ' <br/> '; return $teacher->getdata (' name '); $this->assign (' Teachers ',$Teachers);//passing data like a view $this->assign (' page ',$page);//It's going to be re-routed . $htmls=$this-fetch (); //returning data to a user return $htmls; }Catch(\think\Exception\httpresponseexception$e){ Throw $e; }Catch(\Exception $e){ return $e-GetMessage (); }}//Qian Feng php-php Training

About method not Exist:think\db\query->render error resolution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.