Home > Backend Development > PHP Tutorial > 克隆一个新项目的快捷方式_PHP

克隆一个新项目的快捷方式_PHP

WBOY
Release: 2016-06-01 12:08:02
Original
816 people have browsed it

有没想过最土的项目如何快速复制出一个来,然后改改就成新的团购项目了?

或者说编辑一个老项目的时候想把他另存为一个新项目而不是保存,

看下图 红色部分

zuituclone

具体开发代码(非细节),如下

修改模板,加入按钮

include/template/manage_team_edit.html

加js 处理cloneteam函数

function cloneteam()
{
document.getElementById(‘-user-form').action=”/manage/team/edit.php?clone=1″;
document.getElementById(‘-user-form').submit();
}

注意 clone=1

另外修改模板加了几处隐藏的hidden 内容,目的是为了复制老项目中的image image1 image2 字段

修改 manage/team/edit.php

原来代码是这样的

zuit-clone-team1

现在代码是这样的

zuit-clone-team2

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template