find返回數組,get返回對象(在模型里用靜態方法調用);
get是Model類里的,find是Query類里的,Model里get的實現,最終調用的還是find
* * * * *
namespace think
class Console
~~~
/**
* 獲取指令
* @param string $name 指令名稱
* @return Command
* @throws \InvalidArgumentException
*/
public function get($name)
{
if (!isset($this->commands[$name])) {
throw new \InvalidArgumentException(sprintf('The command "%s" does not exist.', $name));
}
$command = $this->commands[$name];
if ($this->wantHelps) {
$this->wantHelps = false;
/** @var HelpCommand $helpCommand */
$helpCommand = $this->get('help');
$helpCommand->setCommand($command);
return $helpCommand;
}
return $command;
}
~~~
get方法傳遞的數據采用的是顯式的,直接輸出在URL上;post方法傳遞數據的方法是隱式的,適用于一些表單數據的提交。(待確定)