有没有办法将$ this-> find('all')数组格式化为视图中的$ this-> find('list')?我问的原因是我可以将新数组传递给表单助手选项,然后使用$ this-> find('all')数组来构建一些我需要的其他东西?
Array (
[0] => Array ( [School] => Array ( [id] => 0 [name] => Nature [address] => 112 Main [max_students] => 25 [application_level] => 5 ) )
[1] => Array ( [School] => Array ( [id] => 1 [name] => Math [address] => 112 Smith [max_students] => 25 [application_level] => 0 ) )
[2] => Array ( [School] => Array ( [id] => 2 [name] => Art [address] => 112 Lane [max_students] …Run Code Online (Sandbox Code Playgroud) 我在编译编译器时遇到错误,但我不知道为什么。我正在运行 OS X 10.9.1 和最新的 Xcode。
parser.y:1.1-5: 无效指令:`%code' parser.y:1.7-9: 语法错误,意外标识符
这是我的 parser.y 的代码
%code top {
#include "frontend.h"
#include "type.h"
#include "ast.h"
#include "env.h"
#include <glib.h>
#include <assert.h>
#include <stdio.h>
#include <string.h>
extern int yylex(void);
extern int yyerror(const char*);
}
%code requires {
#include "type.h"
#include "ast.h"
#include <glib.h>
}
%union {
char* id;
char* str;
int num;
GList* list;
Type* type;
struct exp* exp;
struct decl* decl;
struct stmt *stmt;
struct GList *stmts_list;
};
%type <exp> exp
%type <exp> …Run Code Online (Sandbox Code Playgroud) 所以,我在这行代码上遇到错误;
else if(lockError == EBUSY)
Run Code Online (Sandbox Code Playgroud)
我得到了错误;
use of undeclared identifier 'EBUSY'
Run Code Online (Sandbox Code Playgroud)
如何将我的int lockError与我尝试pthread_mutex_unlock时可能返回的EBUSY进行比较.