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.

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

报告相同问题?