首页 文章
  • 0 votes
     answers
     views

    PHP致命错误:require()

    我有一个网站,在我的本地主机上使用xampp完美,但是...我上传到几个免费网站托管(000webhost和hostinger),当我尝试打开它时,收到此消息: 警告:require(core / libs / smarty / Smarty.class.php):无法打开流:第7行/home/u327900732/public_html/www/index.php中没有此类文件或目录致命错误:...
  • 0 votes
     answers
     views

    在php中获取Smarty模板名称

    我已经注册了一个负责翻译的块功能 . $ smarty-> register_block(“translate”,“do_translation”); function do_translation($ params,$ content,&$ smarty,&$ repeat) 我可以通过使用PHP中的$ smarty对象以某种方式确定哪个模板文件导致函数调用?或者howelse我可以获取内...
  • 1 votes
     answers
     views

    如何用php在smarty模板中设置Cookie?

    我目前在使用.tpl智能模板类的PHP代码块中设置cookie时遇到问题 . 在.tpl类我有一些喜欢: {php} setcookie("school", "test"); {/php} School: { $smarty.cookies.school } 但是这不打印任何东西 . 我知道php setcookie调用只在一个.php文件中工作...
  • 0 votes
     answers
     views

    聪明的搜索功能

    如何在smarty中包含.php文件,从Smarty中的搜索输入处理$ _POST数据并在.tpl文件中显示结果?如何在smarty控制器或配置文件中正确定义search.php?我对这个引擎了解很多东西和技巧index.php smarty core <?php //ob_start('ob_gzhandler'); $t1 = microtime ( 1 ); session_start...
  • 2 votes
     answers
     views

    PHP,mySQL和Smarty模板 . while循环只显示1个数据库条目

    我正在使用php / mysql和smarty(php模板生成器) . 我正在循环一个SQL查询并获取数据显示在.tpl文件上 . $query = "SELECT * from recipes"; $result = mysqli_query($db_server, $query); if ($result->num_rows > 0) { ...
  • 1 votes
     answers
     views

    Smarty模板问题

    我是smarty模板的新手,我正在努力做到这一点 . 我在tpl文件中有一个html表单,并且该表单操作用于php电子邮件功能email.php . 我无法让它发挥作用 . 如果我有完整的代码(html形式的PHP电子邮件代码)并保存为PHP文件,它工作正常 . 有没有办法从该tpl文件中的email.php调用php代码?我是全新的,我只是在网站上做了一些改变 . 问候
  • 0 votes
     answers
     views

    使用AJAX从Smarty调用PHP函数,无需用户操作

    我正在访问许多不同的网站以获取信息列表,我希望在获取信息时显示此信息 . 现在我正在使用Smarty模板,我想做的是: 伪代码: {foreach $page} $smarty_var = use AJAX to call a PHP function Render out a new table row on the fly w/ the newly assigned var ...
  • 0 votes
     answers
     views

    Smarty没有正确调用外部JavaScript文件?

    我有一个奇怪的问题,我似乎无法解决 . 我试图从我的smarty模板目录之外的文件调用javascript函数,它似乎没有工作 . 在我的智能文件中,我有: <script type='text/javascript' src= '../functions/editConcert.js'></script> <form> <input type=&quot...
  • 7 votes
     answers
     views

    强制Smarty显示PHP错误

    我一直在使用PHP一段时间,但对Smarty来说却相当新 . 我正在使用Prestashop,我注意到Smarty似乎吃掉了所有PHP错误 - 当PHP代码出错时,.tpl文件只输出一个空白页面 . 我一直在尝试,但即使出现错误,我也无法让Smarty显示PHP代码输出 . PHP错误报告设置为显示错误 . 所以,举个例子,假设这是example.php文件: <?php //include...
  • 0 votes
     answers
     views

    解析Smarty模板而不触发对用户插件的调用

    我正在写一个(Symfony2)SmartyBundle扩展来支持Assetic . 为了支持stylesheets feature我已经注册了一个名为 stylesheets 的块插件: {stylesheets assets='@SmartyBundle/Resources/public/css/*' debug=true} <a href="{$ass...
  • 1 votes
     answers
     views

    如何将smarty变量传递给php函数?

    PHP CODE: function show_playlist_form($array) { global $cbvid; assign('params',$array); $playlists = $cbvid->action->get_channel_playlists($array); assign('playlists',$playlists...
  • 0 votes
     answers
     views

    smarty如何调用修饰符

    我感到愚蠢,但是,我看过文档,这就是我所做的 . phone_format插件位于:http://smarty.incutio.com/?page=PhoneFormatPlugin 我把它放在一个文件plugins / modifier.phone_format.php我有一个$ smarty-> setPluginsDir(array('./plugins','./plugins_2'...
  • 2 votes
     answers
     views

    使用twbs Pagination插件通过ajax更新smarty变量

    我正在使用twbs分页插件,每次点击页码时,都会触发一个ajax调用,并且每页提取10个结果 . 在页面上传中,前10个结果被提取并分配给smarty变量 . 这是tpl文件 . 我将获取的数组从php分配给变量batchesData并使用foreach循环迭代它以表格形式显示它 <table class="table table-striped projects tablesor...
  • 0 votes
     answers
     views

    从tpl文件调用smarty插件函数时出错

    用下面的代码创建了一个简单的smarty插件 /* * Smarty plugin * ------------------------------------------------------------- * File: function.assignmenu.php * Type: function * Name: assign * Purpose: ...
  • 0 votes
     answers
     views

    在智能模板中从youtube网址获取youtube视频ID?

    我需要解析并从smartt tpl文件中的youtube url获取youtube视频ID . 现在我正在使用插件文件来实现这个使用php preg_match函数 . 但我想使用Smarty正则表达式来解析而不是上面的方法 . 当我通过smarty循环获取视频URL时,我无法在php中解析它并在smarty中进行分配 . 目前我正在使用此代码从smarty的PHP插件文件中获取视频ID . if...
  • 0 votes
     answers
     views

    将php代码分配给smarty模板引擎

    我为我的公司 Build 了一个新的网站,我想使用smarty(v3.1.29) . 现在的问题是我们 store code 所有页面 in our database (家庭,产品,下载,......) . 有些页面包含PHP内联函数,例如: <?php include("functions.php"); ?> <p> Hello <...
  • 17 votes
     answers
     views

    如何自动加载smarty插件

    我们有一个带有Smarty模板引擎的PHP脚本插件, 它可以在的模板文件中使用,但需要确保它在每个模板文件上,问题是: 有没有办法在脚本加载时自动加载此插件? 脚本不是开源的,但Smarty及其文件(如Smarty.class.php等)未加密 . 编辑 我需要做的就是在模板文件加载之前自动加载Smarty插件(与数据库的交互很少),这是否可以/只用Smarty文件实现? (脚本本身是加密的,...
  • 1 votes
     answers
     views

    在Symfony2中,如何直接在智能模板中呈现控制器?

    我是Symfony的新手,到目前为止一切正常,除了以下:我安装SmartyBundle使用Smarty模板引擎而不是默认的Twig . 它运作良好 . 但是在第79页的the Symfony book中,他们解释了一个非常简洁的Twig函数:直接从模板中嵌入控制器结果的能力 . 我没有设法与Smarty合作,所以你知道是否可以做到这一点,以及如何做到这一点? 我想我可以使用forward方法从我当...
  • 0 votes
     answers
     views

    如何将php smarty下拉列表转换为按钮?

    我需要帮助将php smarty下拉到按钮 . 我正在尝试为订阅和取消订阅时事通讯创建两个按钮 . 请帮助 . Php smarty code: private function isNewsletterRegistered($customerEmail) { if (Db::getInstance()->getRow('SELECT `email` FROM '._DB_PREFI...
  • 3 votes
     answers
     views

    将Search.php查询中的值输出到Prestashop中的product-list.tpl

    我需要在product-list.tpl文件中输出Prestashop中classes / Search.php中查询的结果 . classes / Search.php中的查询是: $sql = 'SELECT * FROM `'._DB_PREFIX_.'category_group` cg INNER JOIN `'._DB_...
  • 0 votes
     answers
     views

    Smarty包含动态内容的tpl?

    我有一点聪明的问题,但不知道如何解决这个问题 . 这是我的index.tpl <body> {include file='header.tpl'} {include file='leftmenu.tpl'} <div id=content> {include file="news.tpl" } {include f...
  • 1 votes
     answers
     views

    使用php或javascript过滤结果

    我是使用MySQL开发PHP,Smarty的新手 . 我想就以下方面提出专家意见,或者任何好的建议都会做 . 所以我做了一个index.php连接到数据库(MySQL)也是Smarty,通过查询读取我的数据并从我的index.tpl文件中显示它们 . 对于我的产品,product.php连接到数据库,进行查询,并在product.tpl页面上显示我的产品 . 对于我的index.php,我想添加一...
  • 2 votes
     answers
     views

    prestashop 1.7如何在后台编辑“添加产品”页面

    我正在尝试没有任何成功,编辑主题中的页面,因为我在产品表中添加了7个我想在后台管理的字段 . 我已经看到Prestoshop的1.6版本具有该页面的特定视图,并且向表单添加字段非常简单 . 至于1.7我真的很疯狂,因为我找不到管理“添加产品”页面的任何视图 . 任何提示?我知道它可能与Prestashop中引入Symfony有关,但我不明白 . 谢谢 EDIT 解决方法在此处很好的答案:https...
  • 2 votes
     answers
     views

    使用smarty编译product.tpl时出错

    我试图使用smarty编译this tpl文件 . 我的php文件是this . 但我正在显示错误消息 (!)致命错误:未捕获 - > Smarty编译器:第94行模板“ . \ templates \ product.tpl”中的语法错误“var doesntExist ='“;”未知标签“l”< - 在第94行的C:\ wamp \ www \ Smarty \ libs \ s...
  • 0 votes
     answers
     views

    如何修复erorr“致命错误:未捕获 - > Smarty:无法写入文件”?

    我使用digitalocean将Prestashop从localhost迁移到网站域,但是当我打开这个网站时,我收到了这个错误 致命错误:未捕获 - > Smarty:无法写入文件/ var / www / html / prestashop / cache / smarty / compile / a4 / 36 / f1 / wrt549a35e49b3b44_77591243 &lt...
  • -3 votes
     answers
     views

    我的文件不易读

    我正在尝试将PHP文件包含到tpl文件中我的代码: /**{include_php file='Compteur.php'}**/ Smarty sh 注意:未定义的属性:SmaleyBC :: $ trusted_dir位于/ 730/行的/var/www/vhosts/vps143526.ovh.net/my-wall.fr/dev/tools/smarty/Smarty.class.ph...
  • 0 votes
     answers
     views

    Prestashop后台模块 - 查看/ Smarty / Uncaught异常SmartyException

    我正在努力实现Prestashop后台模块 . 我在安装文件中添加了新的Tab 我在视图的显示上有错误消息 . 我的实现中可能缺少一些东西 . 模块名称为:mydashboard 我将tpl文件放在文件夹/ web / modules / mydashboard / views / templates / admin / mydashboard中 错误消息是 / var / www / clien...
  • 1 votes
     answers
     views

    Prestashop后端和前端模块在某些页面上显示错误

    在前端的某些页面上的PrestaShop 1.6上我收到以下错误和管理员的所有页面当我尝试登录时我收到此错误 致命错误:未捕获 - > Smarty:'/modules/blockbestsellers/views/templates/hook/tab.tpl'的编译模板无效< - 在第182行的/tools/smarty/sysplugins/smarty_internal_tem...
  • 0 votes
     answers
     views

    未捕获SmartyCompilerException:语法服务器迁移模板中的错误

    我正在将Prestashop服务器转移到另一台服务器 . 原始服务器是带有Apache的CentOS,目标是带有Nginx的Ubuntu . 问题是当我在Prestashop中打开产品链接时出现此错误: 致命错误:未捕获SmartyCompilerException:第48行“{/ addJsDefL} {/ strip} {/ if}”模板“/var/www/loja/themes/defau...
  • -1 votes
     answers
     views

    如何修复Prestashop致命错误:未捕获 - > Smarty编译器?

    致命错误:未捕获 - > Smarty编译器:模板中的语法错误“/home/sites/riversoft.com.mk/public_html/admin397ebpwvj/themes/default/template/header.tpl”第256行“headers:{”缓存-control“:”no-cache“},” - 意外“:”,预期之一:“}”< - 抛出/home/...

热门问题