SYMFONY 助手

链接助手系列(Link helpers)
默认已引入
url_for()重构URLurl_for( 'URL_raw' )
link_to()文字链接link_to('link_title', 'URL_raw' [, $options] )
 图像链接link_to(image_tag('img'), 'URL_raw' [, $options] )
button_to()按钮链接button_to('link_title', 'URL_raw' [, $options] )
mail_to()邮件链接mail_to('email_address', 'address title' [, $options])
文本助手(Text helpers)引入声明:use_helper('Text')
truncate_text()裁切文本truncate_text ($text, $length , $truncate_string = '...')
excerpt_text()选摘文本excerpt_text ($text, $sentence, $radius = 100 , $truncate_string = '...')
highlight_text()加亮文本highlight_text($text, $sentence [,$highlighter])
simple_format_text()HTML编码文本simple_format_text($text)
auto_link_text()智能文本链接auto_link_text($text)
image_tag()图像助手image_tag('image_file',[, $options] )
日期助手(Date helpers)引入声明:use_helper('Date')
format_date()日期格式化format_date($date)
format_datetime()日期时间格式化format_datetime($datetime)
format_daterange()日期区间格式化format_daterange($start_date, $end_date, 'MM/yy', 'from %s to %s', 'starting from %s', until %s')
distance_of_time_in_words()时间区间distance_of_time_in_words($from_time, $to_time, $include_seconds = false)
time_ago_in_words()时间过往time_ago_in_words($from_time, $include_seconds = false)
数字助手(Number Helpers)
引入声明: use_helper('Number')
format_number()数字格式化format_number($the_number)
format_currency()货币格式化format_currency($money_number,'CURRENCY_CODE')
国际化助手(International Helpers)
引入声明:use_helper('I18N')
format_country()地区国际化format_country('COUNTRY_CODE')
format_language()语言国际化format_language('LANGUAGE_CODE')
表单助手(Form Helpers)默认已引入
form_tag()表单助手form_tag('test/save',[, $options])…</from>
input_tag()文本框input_tag('name', 'default_value')
textarea_tag()文本域textarea_tag('name', 'default_content', 'size=10x20')
checkbox_tag()复选框checkbox_tag('name', 'value', 'true/false')
radiobutton_tag()单选框radiobutton_tag('name', 'value', 'true/false')
input_file_tag()文件域input_file_tag('name')
input_password_tag()密码框input_password_tag('name', 'value')
input_hidden_tag()隐藏域input_hidden_tag('name', 'value')
submit_tag()提交按钮submit_tag('Save')
submit_image_tag()提交图片按钮submit_image_tag('submit_img')
select_tag()单选选取框select_tag('select_name', options_for_select(Value_array), 'selected_value'))
 多选选取框select_tag('select_name', options_for_select(Value_array), selected_array,'multiple=multiple'))
object_input_tag()对象文本框object_input_tag($object, $method, $options)
object_textarea_tag()对象文本域object_textarea_tag($object, $method, $options)
object_checkbox_tag()对象复选框object_checkbox_tag($object, $method, $options)
object_select_tag()对象选择框object_select_tag($object, $method, $options)
select_country_tag()国家下拉列表select_country_tag('country', 'COUNTRY_CODE')
JavaScript助手(JavaScript helper)引入声明:use_helper('Javascript')
link_to_function()Javascript链接link_to_function('link_title','function_name('parameter') [,$options])
javascript_tag()Javascript代码javascript_tag(" function foobar() {...}") ?>
AJAX表单助手从属于JavaScript助手
update_element_function()更新页面元素update_element_function('element_id', $options)
form_remote_tag()AJAX表单form_remote_tag($options) ?>…</from>
submit_to_remote()AJAX表单按钮submit_to_remote('ajax_submit', 'Add in AJAX', $options))
observe_field()表单元素侦查observe_field('item', $options)
periodically_call_remote()表单整体侦查periodically_call_remote($options)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值