Your goal is to build a simple controller that will know which model and function to run, and then return a JSON object as a response that is usable on the far end of the transaction.
您的目标是构建这样一个简单的控制器:它知道应该运行哪个模型和函数,然后返回一个JSON对象作为响应,这个响应可用于事务的远端。
Instances are created by calling the class object as a function.
实例是将类对象作为函数调用而创建的。
It takes the connection object as a parameter and returns the return code for the function that was executed.
它的参数是连接对象,它返回已经执行的函数的返回码。
The function returns a handle that can be used to access the object as shown in Listing 1.
该函数返回句柄,用以访问清单 1 所示的对象。
It then calls the friend function spacefriend and passes the class object address as its argument, and calls the template function, beginning with integer types and then floating data types.
然后,调用友元函数spacefriend并将类对象的地址作为其参数传递。然后调用template函数,先使用整数类型,然后使用浮点数据类型。
It takes XML data as input, and it converts the XML string into a SimpleXMLElement object, which is sent as input to another (recursive) function in this class.
它接收XML数据作为输入,将xml字符串转化成SimpleXMLElement对象,然后发送给该类的另一个(递归)函数作为输入。
Besides naming the object, the function tells dacscheck that it's running within a CGI context and should use the value of REMOTE_USER as the identity of the user making the request.
除了命名对象外,该函数还告诉dacscheck它运行在一个cgi上下文中,并且应该使用REMOTE_USER的值作为发出请求的用户标识。
Now that I have an enumerable object, I define a table-valued function just as I did with the RegexMatches function.
由于拥有可枚举对象,因此我定义表值函数的过程与定义regexmatches函数的过程一样。
In the previous code snippet, after the load is completed, the XML returned from the server is referenced in the data object, which is sent as a parameter to the function originally passed.
在前述的这个代码片段中,完成加载之后,从服务器返回的XML在data对象中被引用,此对象作为参数发送给最初传递的函数。
The XSLTProcessor function requires its source document and stylesheet as a DOMDocument object rather than as strings.
XSLTProcessor函数要求源文档和样式表是一个DOMDocument对象,而不是一个字符串。
A friend function named spacefriend, which is a friend of class space, and which takes the class object as an argument and prints the value of its variable x.
名为spacefriend的友元函数,它是space类的友元,它的参数是类对象,输出类对象的x变量的值。
The generatePDF function creates an InvoicePdf object, calls its CreateInvoice method, then sends the PDF document as a download named Your_Invoice.pdf to the user's browser.
generatepdf函数创建了一个InvoicePdf对象,调用其CreateInvoice方法,然后发送一个名为Your _ Invoice .pdf的下载pd f文档给用户的浏览器。
This next function will demonstrate the ability to not only return values, but to return an object, such as a String. Add the following function to native.c.
接下来的函数将不仅演示返回值的能力,还会演示返回例如字符串这样的对象的能力。
It USES the convenient require function that is imported automatically into the current scope (as we'll discuss in the section called "the Predef Object" in Chapter 7, the Scala Object System).
它使用了方便的require函数,这个函数是被自动导入到当前的作用域中的(正如我们将在《第7章- Scala对象系统》的“预定义对象”章节所要讨论的)。
It will pass the event object to that function as its argument.
它将事件对象作为参数传递给这个函数。
At the core of functional programming is the function, just as classes are the primary abstraction in object-oriented languages.
函数式编程的核心是函数,就像面向对象语言的主要抽象方法是类。
The object pointer is passed as the first argument to the function.
其对象指针作为函数的第一个参数被传递。
To move, modify, or delete a graphics element, this ID is passed as a parameter to the respective member function on the containing Canvas object.
要移动、修改或者删除图形元素,该ID将作为参数传递给包含画布对象的各个成员函数。
The result of the function is returned as a CLOB (Character Large Object) data type that can hold up to 1 MB of data.
函数的结果会以CLOB(字符型大型对象)数据类型的形式返回,可容纳1MB 的数据。
Function (4) gets the result row as a PHP object.
函数(4)以php对象的形式返回结果行。
It takes a function as its parameter and applies the function sequentially to each object in the Array.
它使用一个函数作为它的参数,然后依次将这个函数应用到Array中的每个对象中。
Finally, if we want to add some behavior to the object, we first define an EcmaScript function and then assign it as a property of the object.
最后,我们希望在对象中加入一些行为,就先定义一个EcmaScript函数,然后把它指定为对象的一个属性。
Because the function parameters are transmitted as request parameters, their values are obtained from the param object.
由于函数参数是作为请求参数传输的,可以从param对象获得它们的值。
The closure captures the information about the actual Web service method stub to be invoked (the function object called obj) as well as the stream for the log output.
闭包捕获真正被调用的Web服务方法存根(称为obj的函数对象)以及流作为日志输出。
The public function Add in RelatedContexts object takes the second parameter as a flag to indicate whether the external connection is set for autoconnect or not.
这个添加在RelatedContexts对象中的公共功能将第二个参数当作一个标识符,来显示外部连接是否是自动连接。
Just as iterators are a generalization of Pointers, function objects are a generalization of functions: a function object is anything that you can call using the ordinary function call syntax.
正像iterators是指针的一般化,函数对象是函数的一般化:一个函数对象是你可以使用普通函数调用语法。
The concept behind duck typing, also known as late binding, is pretty simple; if an object responds to all the methods a function is expected to call, that object can be passed to the function.
Ducktyping背后的概念非常简单,就是所谓的迟绑定;如果对象具有某个函数希望调用的所有方法,就可以将这个对象传递给该函数。
Just put it through the json_encode function, and it comes out the other side as a json serialized object.
只需将其传入json_encode函数,然后它将从另一端作为json序列化对象传出。
When invoked with the new operator, the constructor function creates what is known as a prototype for an object; that is, it creates a template from which to build objects of the given kind.
当调用new操作符时,构造函数就为对象创建一个所谓的原型(prototype);也就是说,它创建了一个模板(template),从中构建给定类型的对象。
Actually, you may have guessed the answer: the special thing about methods is that the object is passed as the first argument of the function.
实际上,你可能已经猜到了答案:方法的特别之处在于实例对象作为函数的第一个参数传给了函数。
应用推荐