I lawsuits the other PHP framework to develop a framework of their own, please give us guidance

Source: Internet
Author: User
I draw from other PHP framework to develop their own framework, please point out

I learn from other PHP framework such as Autocrud, and ror ideas. A framework developed by oneself

?

The system automatically generates individual files of model, controller, and view according to the built-in database:

?

I am a beginner, please give us a lot of advice

?

Model:

?

Include "connect.php";
Class users extends connect{??
? function Add ($data) {
?? $this->crud->users->insert ($data);
?}
function Select (erby, $where, $currentpage, $paging) {
?? $this->crud->users->orderby = "erby";
?? $this->crud->users->where = "$where";
?? $paging ==1? $this->crud->users->paging = true: $this->crud->users->paging = false;
?? $this->crud->users->perpage = 2;
?? $this->crud->users->currentpage = $currentpage;
?? return $this->crud->users->select ();
?}
? function Get ($id) {
?? return $this->crud->users->get ($id);
?}
? function Delete ($id) {
?? return $this->crud->users->delete ($id);
?}
? function Update ($data, $id) {
?? return $this->crud->users->update ($data, $id);
?}
}
?>

?

?

Controller

?

Include (' models/users.php ');
Include (' smarty/template.php ');
$TPL = new Smarttemplate ("views/listusers.htm");
$users = new users;
erby = "";
$where = "";
$currentpage = $_get[' page '];
$userss = $users->select (erby, $where, $currentpage, 0);
$rows = count ($userss);
$userss = $users->select (erby, $where, $currentpage, 1);
$i = 0;
if ($rows > 0) {
??? for ($j = 0; $j < count ($userss); $j + +) {
???? $i = 1-$i;
???? ($i ==0)? $bgcolor = "#eff1f3": $bgcolor = "#feefd5";
???? $userss [$j][bgcolor] = $bgcolor;
?}
}
$TPL->assign (Array (
"Userss" = $userss,
"Rows" = $rows));
$tpl->output ();
?>

?

View

?






There is no record you are looking for! New..







Id Name Operation
{ID} {Name} Delete the edit view



?

?

  • 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.