tp5项ç®ä¸æ¨¡æ¿æ件htmlçæ´æ°åphpåå ¥ãå é¤ä¸å¤å¶æ件çæ¹æ³_php_web-itnose
é¦é¡µ
asp
php
javascript
iis
apache
html/css
coldfusion
ajax
vbscript
cgi
xml/xsl
è·¨æµè§å¨å¼å
ruby/rails
ç¨åºå
html5
jquery
seo
jboss
json
angularjs
markdown
nginx
thinkphp
yii
pageadmin
extjs
wampserver
kendo ui
coffeescript
gulp
ecmascript
bootstrap
itnoseé¦é¡µ > web > php >
tp5项ç®ä¸æ¨¡æ¿æ件htmlçæ´æ°åphpåå ¥ãå é¤ä¸å¤å¶æ件çæ¹æ³
2017-06-07 13:05
项ç®æ¯thinkphp5çï¼åå°æä¸ä¸ªï¼ä¸ä¼ html模æ¿ä»£ç çåè½ã
å 为模æ¿é,é¤äºhtml代ç å¤ï¼è¿æ,
{volist name=”list” }{/volist}
{$title}
php,js代ç ã
ææ¯è¿æ ·åçï¼å 建ä¸ä¸ªtemplate表ã
create table hk_template
(
id int(10) primary key not null,
name varchar(30),
content text comment ‘markdownä»£ç ’,
content_html text comment ‘htmlä»£ç ’,
filepath varchar(255) comment ‘æå¨ä½ç½®,æ¯å¦:application/index/view/special/detail.html’,
status tinyint(1) default ‘1’ comment ‘1å¯ç¨ï¼0ä¸å¯ç¨’,
create_time int(10),
update_time int(10),
create_uid int(10),
update_uid int(10)
);
åå ¥ï¼ç¨textareaæ¡ï¼å°ï¼ä»£ç å ¨é¨åå ¥å°contentä¸ã
å¨åå ¥æååï¼åå°content,çå 容ï¼
æ¾å¨å°æ¨¡æ¿æ件ä¸ã
å 为å¨/public/index.phpä¸æå®ä¹app_path,
// [ åºç¨å
¥å£æ件 ]
// å®ä¹åºç¨ç®å½
define(‘app_path’, __dir__ . ‘/../application/’);
define(‘web_url’, ‘http://’.$_server[‘http_host’]);
// å è½½æ¡æ¶å¼å¯¼æ件
require __dir__ . ‘/../thinkphp/start.php’;
.editæ¹æ³å¦ä¸ï¼
public function edit($id){
$template = model(‘template’);
if(is_post){
$data = $_post;
// æ交表�
$result = $template->allowfield(true)->save($data,[‘id’=>$data[‘id’]]);
if ($result) {
// ç®æ æ件: application/index/view/special/detail.htmlï¼æ¿æ¢éé¢çå
容ã
//
$filename = app_path.’index/view/specail/detail.html’;
// chmod($filename, 777); //åè¿ä¸å¥æ æéä¿®æ¹ï¼å°±åªå¥½å¨ç®å½ä¸æå¨ä¿®æ¹äº
$file = fopen($filename, “w”); //以å模å¼æå¼æ件
fwrite($file, $data[‘content’]); //åå
¥ç¬¬ä¸è¡
fclose($file); //å
³éæ件
return $this->success(“æ´æ°æåï¼”, url(‘admin/template/index’));
} else {
return $this->error($template->geterror(), url(‘admin/template/add’));
}
}else{
// ����
if(!$id){
$this->error(‘éæ³æä½’);
}
$info = $template->where(‘id’,$id)->find();
if(!$info){
return $this->error($template->geterror());
}
$this->assign(‘info’,$info);
$this->setmeta(‘模æ¿ï¿½ï¿½’);
return $this->fetch();
}
}
ä¸é¢æ¯è½¬è½½èªï¼
http://www.jb51.net/article/68202.htm
æ¬æå®ä¾è®²è¿°äºphpåå ¥ãå é¤ä¸å¤å¶æ件çæ¹æ³ãå享ç»å¤§å®¶ä¾å¤§å®¶åèãå ·ä½å¦ä¸ï¼
åå ¥ï¼
2. å é¤ï¼
3.å¤å¶ï¼
å¸ææ¬ææ述对大家çphpç¨åºè®¾è®¡ææ帮å©ã
ç¸å
³æç´¢ï¼
html5项ç®
vb.net å¤å¶æ件
html5çä¼ç¹
vb.net å é¤æ件
html5çå¼åå·¥å
·
ç¸å ³æç«
2017-03-16 21:11 tp5 urlçæ¼æ¥
2017-03-24 21:28 tp5
2017-02-11 22:44 tp5çé®é¢ï¼ä¸ä¸ªç®åçé®é¢ï¼ã
2016-12-04 07:30 phpç¢ç ââå é¤é¤æå®æ件çå
¶ä»æ件åç®å½
2016-08-13 17:51 php读åç®å½ååç®å½ä¸æææ件åçæ¹æ³
æ´å¤ç¸å ³æç« >>
ææ°æç«
2017-06-20 01:35 èé们ï¼æ没æå¯è½è®©phpæ件åæ¶åªè½ä¸ä¸ªäººè®¿é®
2017-06-20 01:35 æä¹ç¦æ¢å¾çç´æ¥éè¿url访é®
2017-06-20 01:35 æ±æ!å¯å¨wampåªè½ç¨æ¬æºè®¿é®,åå±åç½çå
¶å®è®¾å¤è®¿é®ä¸å°!æäºå¤§å天t-t
2017-06-19 15:35 nginxä¸çthinkphpé®é¢
2017-06-19 15:35 php form æ件ä¸ä¼
æ´å¤ææ°æç« >>
çé¨æç´¢
spring ä¸ejbçåºå«
html5模æ¿
php html5
ä¼åæ°æ®åºçæ¹æ³
html5 ç½ç«æ¨¡æ¿
vbä¸vb.netçåºå«
vb.netä¸vbçåºå«
å¦ä¹ htmlçç½ç«
html5ä¸flash
flashä¸html5
html5ç½é¡µæ¨¡æ¿
vb6.0ä¸vb.netçåºå«
html模æ¿
jspæ件
xmlæ件
京icpå¤14022385å·-2
©2014 itnose软件ç¼ç¨æç¨ | èç³»æ们ï¼emailï¼twobrushes@126.com qq:35155868