【问题标题】:Show custom page content显示自定义页面内容
【发布时间】:2015-10-06 09:26:06
【问题描述】:

首先感谢大家的帮助。

我正在尝试在收件箱页面上显示自定义内容。我的代码如下所示:

 <?php 
$page = basename($_SERVER['REQUEST_URI']);
if ($page == 'messages' || $page == "/" || $page == 'inbox') {
?>
@if ($buttons or $showSearchBox)
<div class="toolbar top">
    {!! $buttons !!}

    @if ($showSearchBox)
        <div class="model-search-box">
    @if (user()->countMessages() > 0)
        <div class="inbox-notify">
    You have unread messages, please read that!
    </div>
    @endif
            {!! Form::open(['url' => URL::current().'/search']) !!}
                    {!! Form::text('search', $searchString, array('placeholder'=>'Search in messages ), ['class' => 'search-string']) !!}
                    {!! Form::submit(trans('app.search'), ['class' => 'button-search']) !!}
            {!! Form::close() !!}
        </div>
    @endif
  </div>
@endif
    <?php } ?>

但此代码仅适用于“消息/收件箱”页面。我怎样才能在“消息/发件箱”页面上添加此内容?抱歉英语不好。我是这方面的新手:)

【问题讨论】:

    标签: php messages inbox


    【解决方案1】:
     <?php 
        $page = basename($_SERVER['REQUEST_URI']);
        if ($page == 'messages' || $page == "/" || $page == 'inbox' || $page == 'outbox') {
        ?>
        @if ($buttons or $showSearchBox)
        <div class="toolbar top">
            {!! $buttons !!}
    
            @if ($showSearchBox)
                <div class="model-search-box">
            @if (user()->countMessages() > 0)
                <div class="inbox-notify">
            You have unread messages, please read that!
            </div>
            @endif
                    {!! Form::open(['url' => URL::current().'/search']) !!}
                            {!! Form::text('search', $searchString, array('placeholder'=>'Search in messages ), ['class' => 'search-string']) !!}
                            {!! Form::submit(trans('app.search'), ['class' => 'button-search']) !!}
                    {!! Form::close() !!}
                </div>
            @endif
          </div>
        @endif
            <?php } ?>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-22
      • 1970-01-01
      • 1970-01-01
      • 2019-09-14
      • 1970-01-01
      相关资源
      最近更新 更多