我阅读文档的Laravel网站,堆栈溢出,并且谷歌,但还是不明白之间的差别Route::resource和Route::controller.
其中一个答案说Route :: resource是为了crud.但是,使用Route :: controller,我们可以完成与Route :: resource相同的操作,我们只能指定所需的操作.
他们看起来像兄弟姐妹:
Route::controller('post','PostController');
Route::resource('post','PostController');
Run Code Online (Sandbox Code Playgroud)
我们如何选择使用什么?什么是好习惯?
使用Zend_Db_Table从表中选择列的最大值的最简单最简单的方法是什么?基本上,我只想在Zend中运行此查询:
SELECT MAX(id) AS maxID FROM myTable;
Run Code Online (Sandbox Code Playgroud) 我知道您可以使用 echo 在控制台上打印信息。但我试过用整数返回,但对我来说效果不佳。
作为
function echo_test() {
echo 1;
}
function output_echo() {
local result="$(echo_test)";
if [[ ${result} == 1 ]]; then
echo great;
else
echo nope;
fi
}
Run Code Online (Sandbox Code Playgroud)
输出“很棒”,但是:
function return_test() {
return 1;
}
function output_return() {
local result="$(return_test)";
if [[ ${result} == 1 ]]; then
echo great;
else
echo nope;
fi
}
Run Code Online (Sandbox Code Playgroud)
没有工作......并输出“不”。
I'm working on a project right now that makes use of plenty of information on selects. Is there any way to group this information using native Angular (5/6?) functions? I tried the ng-select component but did not perform well.
My :
<div class="form-group">
<label for="disbursementType" class="ng-required">Typ wyp?aty</label>
<select id="disbursementType" class="form-control"
name="disbursementType" required [(ngModel)]="hero.power" #power="ngModel" >
<option *ngFor="let disbursementTypeOption of disbursementTypeOptions"
[value]="disbursementTypeOption.key">{{disbursementTypeOption.title}}</option>
</select>
</div>
Run Code Online (Sandbox Code Playgroud)
And this is my class variable
disbursementTypeOptions = [
{
"key": 1,
"title": "Przelew na konto", …Run Code Online (Sandbox Code Playgroud)