本人龟鉴其他PHP Framework 自己开发的一个Framework,请大家指点
本人借鉴其他PHP Framework 自己开发的一个Framework,请大家指点
本人借鉴其他PHP Framework如autocrud等,还有ror的思想.?自己开发的一个Framework
?
系统根据建好的数据库自动生成model、controller和view的各个文件:
?
本人是初学者,请大家多多指点
?
Model:
?
include "connect.php";
class users extends Connect{??
?function Add($data){
??$this->crud->users->insert($data);
?}
?function Select($orderby,$where,$currentpage,$paging){
??$this->crud->users->orderby = "$orderby";
??$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;
$orderby = "";
$where = "";
$currentpage = $_GET['page'];
$userss = $users->Select($orderby,$where,$currentpage,0);
$rows = count($userss);
$userss = $users->Select($orderby,$where,$currentpage,1);
$i = 0;
if($rows > 0){
??? for($j = 0; $j ???? $i = 1-$i;
???? ($i==0) ? $bgcolor="#eff1f3" : $bgcolor="#feefd5";
???? $userss[$j][bgcolor] = $bgcolor;
?}
}
$tpl->assign(array(
"userss"=>$userss,
"rows"=>$rows));
$tpl->output();
?>
?
view:
?
没有您要查找的记录! 新增..
id
name
操作
{id}
{name}
删除 编辑 查看
?
?

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Many users will choose the Huawei brand when choosing smart watches. Among them, Huawei GT3pro and GT4 are very popular choices. Many users are curious about the difference between Huawei GT3pro and GT4. Let’s introduce the two to you. . What are the differences between Huawei GT3pro and GT4? 1. Appearance GT4: 46mm and 41mm, the material is glass mirror + stainless steel body + high-resolution fiber back shell. GT3pro: 46.6mm and 42.9mm, the material is sapphire glass + titanium body/ceramic body + ceramic back shell 2. Healthy GT4: Using the latest Huawei Truseen5.5+ algorithm, the results will be more accurate. GT3pro: Added ECG electrocardiogram and blood vessel and safety

Why Snipping Tool Not Working on Windows 11 Understanding the root cause of the problem can help find the right solution. Here are the top reasons why the Snipping Tool might not be working properly: Focus Assistant is On: This prevents the Snipping Tool from opening. Corrupted application: If the snipping tool crashes on launch, it might be corrupted. Outdated graphics drivers: Incompatible drivers may interfere with the snipping tool. Interference from other applications: Other running applications may conflict with the Snipping Tool. Certificate has expired: An error during the upgrade process may cause this issu simple solution. These are suitable for most users and do not require any special technical knowledge. 1. Update Windows and Microsoft Store apps

Part 1: Initial Troubleshooting Steps Checking Apple’s System Status: Before delving into complex solutions, let’s start with the basics. The problem may not lie with your device; Apple's servers may be down. Visit Apple's System Status page to see if the AppStore is working properly. If there's a problem, all you can do is wait for Apple to fix it. Check your internet connection: Make sure you have a stable internet connection as the "Unable to connect to AppStore" issue can sometimes be attributed to a poor connection. Try switching between Wi-Fi and mobile data or resetting network settings (General > Reset > Reset Network Settings > Settings). Update your iOS version:

Mixin in Vue is a very useful feature. It can encapsulate some reusable code in a mixin object, and then use mixin to introduce it in the components that need to use these codes. This method greatly improves the reusability and maintainability of the code, especially in some repeated CRUD (add, delete, modify) operations. This article will introduce how to use mixins to implement CRUD operations in Vue. First, we need to understand how to create a

Laravel is one of the most popular PHP frameworks today, providing rich functionality and a convenient development experience. LaravelNova is an admin interface builder designed specifically for Laravel applications, helping you create and manage backend admin panels more easily. In this article, we will look at how to use LaravelNova for CRUD operations. What are CRUD operations? CRUD is the abbreviation for "Create, Read, Update and Delete". These four operations are useful for any application

How to use MongoDB to develop a simple CRUD API In modern web application development, CRUD (Create, Delete, Modify, Check) operations are one of the most common and important functions. In this article, we will introduce how to develop a simple CRUD API using MongoDB database and provide specific code examples. MongoDB is an open source NoSQL database that stores data in the form of documents. Unlike traditional relational databases, MongoDB does not have a predefined schema

How to use Vue and Axios to implement CRUD operations on data. In front-end development, it is often necessary to interact with the back-end server to perform CRUD operations on data. Vue is a popular JavaScript framework that helps us build interactive user interfaces. Axios is a Promise-based HTTP library that can help us easily communicate data with the server. By combining Vue and Axios, we can easily implement CRU of data

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code
