我想知道是否可以通过一些htaccess规则来实现最终结果。
在 config 文件夹中。其中*是要显示为文件夹的页面名称。
/projectdir/config/?p=* or /projectdir/config/index.php?p=*
to /projectdir/config/*/
实施例
/projectdir/config/?p=page1 => /projectdir/config/page1/
/projectdir/config/index.php?p=page1 => /projectdir/config/page1/
我尝试了this问题中发布的代码,但没有结果
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([\w\d~%.:_\-]+)$ index.php?p=$1 [NC]
答案 0 :(得分:1)
您可以在class ViewController: NSViewController {
var dataToPass: String = "DataToPass"
override func viewDidLoad() {
super.viewDidLoad()
}
override func viewWillAppear() {
performSegue(withIdentifier: NSStoryboardSegue.Identifier(rawValue: "segueIdentifier"), sender: self)
}
override func prepare(for segue: NSStoryboardSegue, sender: Any?) {
if segue.identifier!.rawValue == "segueIdentifier" {
let destinationViewController = segue.destinationController as! ViewController2
destinationViewController.dataToReceive = dataToPass
}
}
}
class ViewController2: NSViewController {
var dataToReceive: String
override func viewDidLoad() {
super.viewDidLoad()
}
}
:
/project/config/.htaccess