[請益] smarty如何崁入文章編輯器
之前以news_add.php做好畫面
其中要轉換成編輯器的部份是
<textarea id="editor1" name="editor1"></textarea>
<?php
include_once "ckeditor/ckeditor.php";
$CKEditor = new CKEditor();
$CKEditor->basePath = 'ckeditor/';
$CKEditor->replace("editor1");
?>
有成功導入'梅問題教學的[CKeditor網頁編輯器]'
但轉換成smarty的程式與版面分割寫法
勢必要把之前的畫面檔news_add.php 轉換成news_add.tpl檔放在[templates]
此時寫在原來畫面檔的
<?php
include_once "ckeditor/ckeditor.php";
$CKEditor = new CKEditor();
$CKEditor->basePath = 'ckeditor/';
$CKEditor->replace("editor1");
?>
必須拿掉放在smarty寫法的news_add.php檔中
<?php
include('../lib/main.php');
include_once "ckeditor/ckeditor.php";
$CKEditor = new CKEditor();
$CKEditor->basePath = 'ckeditor/';
$CKEditor->replace("editor1");
$tpl -> assign("editor1",$CKEditor);
$tpl -> display('news_add.tpl.htm');
?>
可是沒反應
是因為replace("editor1")替換失敗嗎
還是哪裡出問題呢??
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.219.77.19
※ 編輯: kpdream 來自: 61.219.77.19 (06/17 01:12)
→
06/17 01:58, , 1F
06/17 01:58, 1F
→
06/17 01:59, , 2F
06/17 01:59, 2F
→
06/17 07:48, , 3F
06/17 07:48, 3F
→
06/17 12:32, , 4F
06/17 12:32, 4F
→
06/17 19:53, , 5F
06/17 19:53, 5F
→
06/17 19:54, , 6F
06/17 19:54, 6F
PHP 近期熱門文章
PTT數位生活區 即時熱門文章
154
159