【问题标题】:SilverStripe Admin ChangesSilverStripe 管理员更改
【发布时间】:2017-05-30 06:24:48
【问题描述】:

我正在尝试添加新的设置页面和电子邮件页面。当你点击 emails 菜单时,它在 silverstripe admin cms 下,但重新加载 Emails 页面后,它不在 silverstripe admin cms 下。

那么它不在admin cms下的原因是什么?

这是控制器代码:

public function index() {
    $getmem=Member::currentUser();
    if($getmem->RainloopEmail !='' && $getmem->Pass !='')
    {
        $com=$getmem->RainloopEmail.":".$getmem->Pass;
        $encrypted = base64_encode($getmem->RainloopEmail) ;
        $rainloopemail=$encrypted;
        $encrypted =base64_encode($getmem->Pass);
        $pss=$encrypted;

        $hash=base64_encode($com);

    }
    else
    {
        $rainloopemail='';
        $pss='';
        $com=$getmem->RainloopEmail.":".$getmem->Pass;
        $hash=base64_encode($com);

    }
    $url='http://op.mctitsolutions.com/rainloop/rainloop.php?hash='.$hash;
    $arrayData = new ArrayData(array(
'Width' => '100%',
'Height' => '100%',
'Location'=>$url ));

return $arrayData->renderWith(Array('EmailsAdminController_Content','Coach_message','Page'));

}

这里是模板文件代码:

<div style="padding:55px 20px">
$EditForm
<iframe  id="MainPopupIframe"  width="$Width" height="605px" src="$Location"></iframe>

那么它不在admin cms下的原因是什么?

【问题讨论】:

  • 你有什么问题?
  • @3dgoo 为什么要减去投票?添加了问题?
  • 我没有否决你的问题。我只能猜测您的问题被否决的原因。这是我认为您的问题存在的一些问题。希望您发现这对尝试改进您的问题很有用。
  • 这个问题缺乏足够的信息来诊断问题。目前尚不清楚您的问题或问题是什么。尝试用最少的代码编写一个简单的问题示例,以便其他人可以重新创建问题。说明你正在尝试做什么,你期望什么结果,你得到什么结果,并展示你为克服这个问题所做的努力。

标签: php silverstripe


【解决方案1】:

这是我的答案。

在控制器中添加了新功能。和循环用于在模板文件中显示。这解决了我的问题。

public function getViewEmails() {
    $hash='';
            $getmem=Member::currentUser();
    if($getmem->RainloopEmail !='' && $getmem->Pass !='')
    {
        $com=$getmem->RainloopEmail.":".$getmem->Pass;
        $encrypted = base64_encode($getmem->RainloopEmail) ;
        $rainloopemail=$encrypted;
        $encrypted =base64_encode($getmem->Pass);
        $pss=$encrypted;

        $hash=base64_encode($com);

    }
    else
    {
        $rainloopemail='';
        $pss='';
        $com=$getmem->RainloopEmail.":".$getmem->Pass;
        $hash=base64_encode($com);

    }
    $url='http://op.mctitsolutions.com/rainloop/rainloop.php?hash='.$hash;
        return new ArrayList(array(
                new ArrayData(array(
                        'Url'=>$url,
                        'Width' => '100%',
                ))
        ));
}

这是我的模板文件。

<div style="padding:55px 20px">

<% loop ViewEmails %>
<iframe  id="MainPopupIframe"  width="$Width" height="605px" src="$Url">
 </iframe>
   <% end_loop %>
</div>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-18
    • 2014-07-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多