【问题标题】:Mediawiki redirect to the edit of a non existing pageMediawiki 重定向到不存在页面的编辑
【发布时间】:2016-03-16 18:33:27
【问题描述】:

我正在添加一个带有扩展的动作

问题是我需要重定向到一个不存在的页面的编辑部分

我试过了

<?php
public function onSubmit( $data ) {

    $title = Title::newFromText( $stringTitle );
    $newArticle = Article::newFromTitle( $title, $this->getOutput() );
    $editor = new EditPage( $newArticle );

    if( count($errors) > 0 ){
        return $errors;
    }

    $editor->edit();
    return false;
}

但它让我编辑当前页面而不是具有不同标题的新页面

我也试过了

$title = Title::newFromText( $stringTitle );
global $wgOut;
$wgOut->redirect( $title->getFullURL() );

我确实重定向到所需的页面,但不是处于编辑模式

【问题讨论】:

    标签: php mediawiki mediawiki-api mediawiki-extensions


    【解决方案1】:

    尝试 $wgOut->redirect( $title->getFullURL( 'action=edit' ) );

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多