我Foo和Phalcon一起写了一堂课.该Foo模型是初始化这个样子.
$this->hasMany('id', 'Foo', 'parent_id', ['alias'=> 'children']);
Run Code Online (Sandbox Code Playgroud)
Foo类已parent_id被实现Foo id.
class Foo extends Model {
public $id;
public $parnet_id;
public $name;
}
Run Code Online (Sandbox Code Playgroud)
然后想要带孩子的名单
$foo = Foo:find();
$children = $foo->children;
Run Code Online (Sandbox Code Playgroud)
现在它返回非常大的对象.我希望得到的父项与获取的foo相同.
怎么了?它有一些逻辑吗?提前致谢.
我想知道如何使用javascript将类添加到父7的下一个元素?我想在选择之后突出显示接下来的六个元素
<table>
<tr>
<td>list item 1</td>
<td>list item 2</td>
<td>list item 3</td>
<td>list item 4</td>
<td>list item 5</td>
</tr>
<tr>
<td>list item 6</td>
<td>list item 7</td>
<td>list item 8</td>
<td>list item 9</td>
<td>list item 10</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
我读到:eq,:lt(索引)选择器,但它不起作用.提前致谢.
我正在尝试在控制器中下载文件,但在控制台中我只看到一堆奇怪的字符而不是下载框。我正在关注这个主题Symfony2-Force 文件下载。
不知道发生了什么......试图找到最简单的解决方案。这是我的代码:
$response = new Response(file_get_contents($file->realPath), 200, array(
'Content-Type' => $file->mimeType,
'Content-Length' => filesize($file->realPath),
'Content-Disposition' => 'attachment; filename=' . $file->name,
));
$response->send();
Run Code Online (Sandbox Code Playgroud)
我什至尝试将最基本的示例与 header() 和 readfile() 一起使用。我的服务器需要特殊配置吗?干杯。