php - PHP - 不识别和显示输入
问题描述
PHP noob 在这里,我被困在我的个人项目中。我想显示一个项目的第二个价格(租赁网站),但我没有显示第二个价格。我将粘贴代码和快照。结果
所以基本上,我希望用户为一个项目输入两个费率并在项目详细信息页面上显示两者。所以问题是二等奖没有注册。
代码分为create.blade.php
(用户进行输入的地方)和details.blade.php
(负责生成的图片)。
<!-- CREATE.BLADE.PHP CODE HERE -->
<!-- customFields -->
<div id="customFields"></div>
<!-- price -->
<?php $priceError = (isset($errors) and $errors->has('price')) ? ' is-invalid' : ''; ?>
<div id="priceBloc" class="form-group row">
<label class="col-md-3 col-form-label" for="price">{{ t('Price') }}</label>
<div class="input-group col-md-8">
<div class="input-group-prepend">
<span class="input-group-text">{!! config('currency')['symbol'] !!}</span>
</div>
<input id="price"
name="price"
class="form-control{{ $priceError }}"
placeholder="{{ t('e.i. 15000') }}"
type="text" value="{{ old('price') }}"
>
<div class="input-group-append">
<span class="input-group-text">
<input id="negotiable" name="negotiable" type="checkbox"
value="1" {{ (old('negotiable')=='1') ? 'checked="checked"' : '' }}> <small>{{ t('Negotiable') }}</small>
</span>
</div>
</div>
</div>
<!-- Price 2-->
<?php $priceError = (isset($errors) and $errors->has('price2')) ? ' is-invalid' : ''; ?>
<div id="priceBloc" class="form-group row">
<label class="col-md-3 col-form-label" for="price2">Rate per Week</label>
<div class="input-group col-md-8">
<div class="input-group-prepend">
<span class="input-group-text">{!! config('currency')['symbol'] !!}</span>
</div>
<input id="price2"
name="price2"
class="form-control{{ $priceError }}"
placeholder="{{ t('e.i. 15000') }}"
type="text" value="{{ old('price2') }}"
>
<div class="input-group-append">
<span class="input-group-text">
<input id="negotiable" name="negotiable" type="checkbox"
value="1" {{ (old('negotiable')=='1') ? 'checked="checked"' : '' }}> <small>{{ t('Negotiable') }}</small>
</span>
</div>
</div>
</div>
<!-- END -->
内容details.blade.php
:
<!--DETAILS.BLADE.PHP CODE HERE -->
@if (!in_array($post->category->type, ['not-salable']))
<!-- Price / Salary -->
<div class="detail-line-lite col-md-6 col-sm-6 col-xs-6">
<div>
<span>
{{ (!in_array($post->category->type, ['job-offer', 'job-search'])) ? t('Price') : t('Salary') }}:
</span>
<span>
@if ($post->price > 0)
{!! \App\Helpers\Number::money($post->price) !!}
@else
{!! \App\Helpers\Number::money(' --') !!}
@endif
@if ($post->negotiable == 1)
<small class="label badge-success"> {{ t('Negotiable') }}</small>
@endif
</span>
</div>
</div>
<!-- Price 2 / Salary -->
<div class="detail-line-lite col-md-6 col-sm-6 col-xs-6">
<div>
<span>
{{ (!in_array($post->category->type, ['job-offer', 'job-search'])) ? t('Price per week') : t('Salary') }}:
</span>
<span>
@if ($post->price2 > 0)
{!! \App\Helpers\Number::money($post->price2) !!}
@else
{!! \App\Helpers\Number::money(' --') !!}
@endif
@if ($post->negotiable == 1)
<small class="label badge-success"> {{ t('Negotiable') }}</small>
@endif
</span>
</div>
</div>
<!-- END-->
谢谢你的帮助 :)
解决方案
推荐阅读
- c++ - C++ 对象(整数)
- ios - 如何使用 NSLayoutConstraint 以编程方式在容器中居中表格页脚视图?
- javascript - 将行项目从一个表移动到另一个表,并在将选定行项目添加到第二个表之前验证在第一个表中输入的数据
- c# - c#语言的功率限制是多少
- java - 使用与我的本地主机相同的配置运行 dropwizard,在 vps 上出现错误
- python-3.x - 老板大战迷你游戏。如何让boss血量一直降到0
- r - 如何将矩阵中的特定字符数存储到R中的另一个向量中
- android - 如何增加 Vector Drawable 的大小?
- php - 如何在php中正确转义电子邮件标头
- speech-recognition - Kaldi:qsub 的输出是:qsub:在尝试运行 Common Voice 配方时非法 -c 值“”