我如何在表格中找到并显示第一个要素的名称?
我猜想,我必须使用像我这样的东西。
$this->data[ lastInvioce ] = $this->Invoice->find( all , array( limit => 1));
......在控制者发现......
我如何在表格中找到并显示第一个要素的名称?
我猜想,我必须使用像我这样的东西。
$this->data[ lastInvioce ] = $this->Invoice->find( all , array( limit => 1));
......在控制者发现......
你的法典几乎是正确的。 <代码>Model:find(<>/code>的第一个参数表明有多少记录可以检索。 <代码>Model:find(所有)检索所有配对记录。 您想要的是Model:find(先)
:
// Retrieve most recent Invoice record
$lastInvoice = $this->Invoice->find( first , array(
fields => array( Invoice.name ),
order => array( Invoice.created => desc )
);
// Make this Invoice record available in the view
$this->set( compact( lastInvoice ));
这将检索最近创建的<代码>Invoice记录,仅检索 姓名/编码>领域。 <代码>$this->set(
)中的数据可在您看来查阅。 因此:
echo $lastInvoice[ Invoice ][ name ];
或者说:
extract($lastInvoice);
echo $Invoice[ name ];
Try $this->Invoice->find(首次,......)
。 当然,你可以利用其他条件和(或)进行操纵。
i have a search form which is shown with Thickbox inside an iframe. the problem is.. that after i click "search" the result page is shown inside the same iframe! and i want it to be shown in the main ...
If I submit a sitemap.xml which does not contain all of the pages of my site, will this affect my search ranking? For example: If my sitemap only contained pages that had been created in the last ...
I have an application that uses lucene for searching. The search space are in the thousands. Searching against these thousands, I get only a few results, around 20 (which is ok and expected). However,...
i made a program that search logical drives to find a specific file .if user type file name an click search button , searching begins , but i don t know how to stop searching in the middle of process....
I have inherited a piece of work where the entry screen shows a summary of 20 calculated variables. E.g. Var A (250), Var B (79). Clicking on any of these links takes the user to a view with a ...
I have an Access app where I use search functionality. I have a TextBox and a Search Button on the form, and it does a wildcard search of whatever the user enters in the TextBox, and displays the ...
I need to implement a custom search in a grid and I would like to find some user interface guidelines that explain the standard way to implement it. I mean this kind of search that is initiated by ...
I am looking for an opinion on the whether to use Google custom search, Yahoo search builder or build my own for web projects (no more than 100 pages of content). If I should build my own - do you ...