douliang1891 2013-08-27 05:54
浏览 120
已采纳

如何使用数据库中的tinymce显示页面

i am learning a zend framework.i am using tinymce editor for displaying dynamic content on website.now i want to display page in which header and footer comes from layout and layout content comes from database table named cms..my whole page content is stored in database..header and footer page i included in layout.phtml.i dont know how to display that with layout my layout page is as below:

<?php echo $this->doctype() ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


          <link rel="stylesheet" type="text/css" href="<?php echo CSS_PATH.'/jquery.jqplot.min.css';?>" />



             <script src="<?php echo CSS_JS.'/jquery.ui.widget.mn.min.js';?>" type="text/javascript"></script>
             <script src="<?php echo CSS_JS.'/jquery.effects.corin.js';?>" type="text/javascript"></script>
             <script src="<?php echo CSS_JS.'/jquery.ui.accordioe.min.js';?>" type="text/javascript"></script>
             <script src="<?php echo CSS_JS.'/jquery.effects.slide.min.js';?>" type="text/javascript"></script>

        <script language="javascript" type="text/javascript" src="<?php echo CSS_JS.'/jqPlot/jquery.jqplot.min.js';?>"></script>
        <script language="javascript" type="text/javascript" src="<?php echo CSS_JS.'/jqPlot/plugins/jqplot.barRenderer.min.js';?>"></script>
        <script language="javascript" type="text/javascript" src="<?php echo CSS_JS.'/jqPlot/plugins/jqplot.pieRenderer.min.js';?>"></script>
        <script language="javascript" type="text/javascript" src="<?php echo CSS_JS.'/jqPlot/plugins/jqplot.categoryAxisRenderer.min.js';?>"></script>
        <script language="javascript" type="text/javascript" src="<?php echo CSS_JS.'/jqPlot/plugins/jqplot.highlighter.min.js';?>"></script>
        <script language="javascript" type="text/javascript" src="<?php echo CSS_JS.'/jqPlot/plugins/jqplot.pointLabels.min.js';?>"></script>

        <script src="<?php echo CSS_JS.'/setup.js';?>" type="text/javascript"></script>
        <script type="text/javascript">

        $(document).ready(function () {
            setupDashboardChart('chart1');
            setupLeftMenu();
            setSidebarHeight();

        });
    </script>
</head>
<body>

</div>

  <?php echo $this->render('header.phtml') ?>
<?php echo $this->layout()->content ?>
 <?php echo $this->render('footer.phtml') ?> 
</body>
</html>

and also when i echo content from database it display php code as it...please help

  • 写回答

1条回答 默认 最新

  • duanbei1709 2013-08-27 12:52
    关注

    The way you do this, is:

    1. Create the <textarea> element in your view (actionName.phtml)
    2. Echo the value of your cms entry into the <textarea> in the view
    3. Do any tinymce initialization in your layout.

    These are the general steps to make it work.

    Also, if I gather correctly, are you trying to keep PHP code in your DB? That is HIGHLY frowned upon, and should not be done, because for the code to be processed, it needs to be run through the eval function, which just opens your site up wide to all sorts of bad behavior.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog