我刚刚在Yii v 2.0.0的"基本"版本上尝试了使用表单教程.我一步一步地跟着它,但我想有些事情是错的.我有EntryForm模型,SiteController有actionEntry,两个视图也在那里.
错误跟踪:
1. in /usr/share/nginx/html/basic/controllers/SiteController.php at line 99
}
public function actionAbout()
{
return $this->render('about');
}
public function actionEntry()
{
$model = new EntryForm;
if ($model->load(Yii::$app->request->post()) && $model->validate()) {
// valid data received in $model
// do something meaningful here about $model ...
return $this->render('entry-confirm', ['model' => $model]);
} else {
// either the page is initially displayed or there is some validation error
2. yii\base\ErrorHandler::handleFatalError()
Run Code Online (Sandbox Code Playgroud) 在运行随SmartGit提供的shell脚本时,
Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /home/User/.smartgit/6/jna-tmp/com/sun/jna/linux-i386/libjnidispatch.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
Run Code Online (Sandbox Code Playgroud)
虽然它打开很好,但我做了提交,
java: cairo-misc.c:380: _cairo_operator_bounded_by_source: Assertion `NOT_REACHED' failed.
smartgithg.sh: line 100: 394 Aborted $_JAVA_EXEC $_VM_PROPERTIES -Xmx${SMARTGITHG_MAX_HEAP_SIZE} -Xverify:none -Dsmartgit.vm-xmx=${SMARTGITHG_MAX_HEAP_SIZE} -jar "$SMARTGIT_HOME/lib/bootloader.jar" "$@
Run Code Online (Sandbox Code Playgroud)
在研究了一下,我发现,
应该使用64位库.(如果这是原因请告诉我该怎么做).
找不到正确的JRE.下载了一个新的JRE并在shell脚本中提供了它的路径.同样的警告和崩溃.
可能导致这种情况的原因,我该如何解决?
例如对于输入 "olly olly in come free"
程序应该返回:
olly: 2
in: 1
come: 1
free: 1
测试写成:
var words = require('./word-count');
describe("words()", function() {
it("counts one word", function() {
var expectedCounts = { word: 1 };
expect(words("word")).toEqual(expectedCounts);
});
//more tests here
});
Run Code Online (Sandbox Code Playgroud)
如何从 word-count.js 文件开始?创建一个方法 words() 或模块 Words() 并在其中创建一个 expectedCount 方法并导出它?
我将字符串视为数组还是对象?在对象的情况下,我如何开始将它们分解成单词并迭代计数?