我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

too long

i have a variable in layout file like this

$bmodal =array(
        'data-target'   =>  '#myModal',
        'data-toggle'   =>  'modal'
    );

I want to call $bmodal in a link in a view file to optimize the code How can i do that? Any one can help? Thanks

You can do this through a helper, you can make your own helper in which you can pass the variable in your link.

Views are rendered before layouts so you can not.

近期文章

  • 将一个行列表从一个表传输到另一个表
  • 如何使用我的类别为移动设备创建Wordpress下拉菜单?
  • NetBeans Include Path未被完全搜索,无论是项目,全局还是PHP
  • Magento产品网格。 显示可配置的产品数量作为关联的简单产品的总和
  • 在jmultiselect2side yii扩展名中,我无法在更新数据后看到所选列表
  • 正则表达式 - php - 获取空格不在前面,后面没有单词
  • 搜索SQL查询
  • 在php上从大文件创建拇指
  • 使用PHP将HTML表单值插入ORacle数据库
  • Smarty无法访问templates_c中的编译文件
  • PHPUnit没有在assertEquals失败时显示差异
  • 使用fetchAll()从PDO对象中进行选择
  • Magento在php脚本中使用final_price
  • 将图像(包含说明)上传到Tumblr
  • 从不同的数据库中选择切换用户吗?
  • Ionauth第一次用户登录+重新发送激活邮件
  • Solr在multiValue字段中返回每个值的每个文档
  • 点击发布并重定向到主页
  • 在value =''字段中添加$ _POST
  • 将内容拆分为布局的最佳方法是什么? [关闭]

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华