我有一个编辑视图,我正在使用部分_form视图。
有没有办法检查表单是补丁还是帖子?
我打算做的是以编辑形式更改隐藏字段
@if (form is post)
{!! Form::hidden('signature') !!}
@else
<div class="form-group">
{!! Form::label('signature', 'Signature: ', ['class' => 'col-md-4 control-label']) !!}
<div class="col-md-6">
{!! Form::text('signature', null, ['class' => 'col-md-2 form-control', 'required']) !!}
</div>
</div>
@endif
因为此变量已保存到DB,我想加载它以进行编辑。
或者检查表单是否发布,也可以发布!
答案 0 :(得分:2)
我通常将变量传递给我设置动作的视图,例如:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
content_filter = djigzo:[127.0.0.1]:10025
djigzo_after_filter_message_size_limit = 512000000
djigzo_before_filter_message_size_limit = 10240000
djigzo_mailbox_size_limit = 512000000
djigzo_mydestination = localhost, svitsolutions.in, mx1.svitsolutions.in
djigzo_myhostname = mx1.svitsolutions.in
djigzo_mynetworks = 103.246.45.0/24, 192.168.15.0/24, 192.168.15.52/32
djigzo_parent_domain_matches_subdomains = relay_domains
djigzo_rbl_clients =
djigzo_reject_unverified_recipient = reject
djigzo_relay_domains = svitsolutions.in
djigzo_relay_transport_host = mail.svitsolutions.in
djigzo_relay_transport_host_mx_lookup =
djigzo_relay_transport_host_port = 25
djigzo_relayhost =
djigzo_relayhost_mx_lookup = mx
djigzo_relayhost_port = 25
djigzo_smtp_helo_name = mail.svitsolutions.in
djigzo_unverified_recipient_reject_code = 450
local_recipient_maps =
local_transport = $mydestination
mail_name = mx1.svitsolutions.in
mailbox_size_limit = ${djigzo_mailbox_size_limit}
message_size_limit = ${djigzo_after_filter_message_size_limit}
mydestination = ${djigzo_mydestination}, mail.svitsolutions.in, svitsolutions.in
myhostname = ${djigzo_myhostname}
mynetworks = 127.0.0.0/8, [::1]/128, ${djigzo_mynetworks}
parent_domain_matches_subdomains = ${djigzo_parent_domain_matches_subdomains}
queue_minfree = 768000000
recipient_delimiter = +
relay_domains = ${djigzo_relay_domains}
relay_transport = relay${djigzo_relay_transport_host?:${djigzo_relay_transport_host_mx_lookup:[}${djigzo_relay_transport_host}${djigzo_relay_transport_host_mx_lookup:]}:${djigzo_relay_transport_host_port}}
relayhost = ${djigzo_relayhost_mx_lookup:${djigzo_relayhost?[}}${djigzo_relayhost}${djigzo_relayhost_mx_lookup:${djigzo_relayhost?]}}${djigzo_relayhost?:${djigzo_relayhost_port}}
smtp_helo_name = ${djigzo_smtp_helo_name?$djigzo_smtp_helo_name}${djigzo_smtp_helo_name:${myhostname}}
smtpd_authorized_xforward_hosts = 127.0.0.1/32, 192.168.15.52/32
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_discard_ehlo_keywords = silent-discard, dsn, etrn
smtpd_etrn_restrictions = reject
smtpd_recipient_restrictions = permit_sasl_authenticated permit_mynetworks reject_unauth_destination ${djigzo_rbl_clients} ${djigzo_reject_unverified_recipient? reject_unverified_recipient}
unverified_recipient_reject_code = ${djigzo_unverified_recipient_reject_code}
然后我使用此变量来构建路由名称:
$action = 'store';
并检测需要采取何种类型的行动:
{!! Form::open(['route' => 'post'.$action, ....
我认为这是实现您尝试实现目标的最简单易懂的方法。你可以做类似的事情。
答案 1 :(得分:0)
试试这个:
git rebase -i <id-of-commit>