本文整理匯總了PHP中users::find方法的典型用法代碼示例。如果您正苦於以下問題:PHP users::find方法的具體用法?PHP users::find怎麽用?PHP users::find使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類users
的用法示例。
在下文中一共展示了users::find方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_profile
public function get_profile()
{
$id = $_GET['id'];
$user = new users();
$res = $user->find($id);
echo json_encode($res);
}
示例2: up
public function up()
{
$users = users::find()->all();
foreach ($users as $user) {
$user->auth_key = Yii::$app->getSecurity()->generateRandomString();
$user->save();
}
}
示例3: die
<?php
if (!isset($_POST['request'])) {
die("No posted data");
}
require "nm-controller.php";
$action = $_SERVER['QUERY_STRING'];
$xml = new SimpleXMLElement(stripslashes($_POST['request'])) or die("Invalid XML");
//Create a network
if ($action == "create") {
//validate user
if (users::find((string) $xml->auth, true) === false) {
die("Authkey invalid");
}
$nn = NeuralMesh::createNetwork((int) $xml->inputs, (int) $xml->outputs, (int) $xml->hidden, (int) $xml->layers);
echo "<response><authkey>{$nn->authkey}</authkey></response>";
exit;
} else {
$nn = NeuralMesh::getNetwork($xml->auth);
}
switch ($action) {
case "destory":
$nn->destroy();
break;
/**
* Run the network
*/
/**
* Run the network
*/
case "run":