Yii::$app->getSecurity()->generatePasswordHash($password);
$model = new User();
$model->emal = 'user@email.ru';
$model->setPassword(123456);
$model->save();
public function setPassword($password)
{
$this->password = Yii::$app->security->generatePasswordHash($password);
}
$wsdl = 'C:\wsdl.xml';
new \SoapClient($wsdl, ['local_cert' => 'path\sign.pem']);
<?php
$keyboard = [
'inline_keyboard' => [
[
['text' => 'Какой-то текст', 'callback_data' => 'данные которые отправятся на webhook когда пользователь нажмет на кнопку']
]
]
];
$encodedKeyboard = json_encode($keyboard);
file_get_contents($website . "/sendmessage?chat_id=" . $chatId . "&text=" . $welcomemessage . "&reply_markup=" . $encodedKeyboard);
This stylesheet cannot be resold by anyone else except Enabled and Cosmin Cotor
[
'label' => '<i class="glyphicon glyphicon-briefcase"></i> Вкладка 3',
'content' => DetailView::widget([
'id'=>'info1',
'model' => $model,
'panel' => [
'heading' => '<h3 class="panel-title">'.$model->Name.'</h3>',
'type'=>DetailView::TYPE_SUCCESS,
],
'attributes' => $info_three,
]),
'encode'=>false,
'headerOptions' => ['class'=> $value ? '' : 'disabled']
],
$discord = new DiscordClient([
'token' => 'userToken',
'tokenType' => 'OAuth'
]);
<div id="stack1" class="modal fade" tabindex="-1" data-focus-on="input:first" style="display: none;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Stack One</h4>
</div>
<div class="modal-body">
<p>One fine body…</p>
<p>One fine body…</p>
<p>One fine body…</p>
<input class="form-control" type="text" data-tabindex="1">
<input class="form-control" type="text" data-tabindex="2">
<button class="btn btn-default" data-toggle="modal" href="#stack2">Launch modal</button>
</div>
<div class="modal-footer">
<button type="button" data-dismiss="modal" class="btn btn-default">Close</button>
<button type="button" class="btn btn-primary">Ok</button>
</div>
</div>
<div id="stack2" class="modal fade" tabindex="-1" data-focus-on="input:first" style="display: none;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Stack Two</h4>
</div>
<div class="modal-body">
<p>One fine body…</p>
<p>One fine body…</p>
<input class="form-control" type="text" data-tabindex="1">
<input class="form-control" type="text" data-tabindex="2">
<button class="btn btn-default" data-toggle="modal" href="#stack3">Launch modal</button>
</div>
<div class="modal-footer">
<button type="button" data-dismiss="modal" class="btn btn-default">Close</button>
<button type="button" class="btn btn-primary">Ok</button>
</div>
</div>
<div id="stack3" class="modal fade" tabindex="-1" data-focus-on="input:first" style="display: none;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Stack Three</h4>
</div>
<div class="modal-body">
<p>One fine body…</p>
<input class="form-control" type="text" data-tabindex="1">
<input class="form-control" type="text" data-tabindex="2">
</div>
<div class="modal-footer">
<button type="button" data-dismiss="modal" class="btn btn-default">Close</button>
<button type="button" class="btn btn-primary">Ok</button>
</div>
</div>
<button class="demo btn btn-primary btn-lg" data-toggle="modal" href="#stack1">View Demo</button>
$('.modal').on('hidden.bs.modal', function (e) {
history.pushState('', document.title, window.location.pathname);
console.log($(this).attr('data-m'));
});
$(window).bind('hashchange', function() {
if(window.location.hash == ''){//Если после # ничего нет, значит закрываем модальное окно(попробуйте открыть модальное окно и в адресной строке удалить все после # после чего у вас закроется модальное окно)
$('.modal').modal('hide');
}
});
history.pushState - позволяет добавить новую запись в сессию истории текущего окна (вкладки). Добавление записи (элемента) осуществляется в конец сессии истории.
public class Main2Activity extends AppCompatActivity {
Authorization mt;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
helloTextView = (EditText)findViewById(R.id.editText);
}
public void onClick(View view) {
mt = new Authorization();
mt.execute();
}
class Authorization extends AsyncTask<Void, Void, Void> {
String resultString = null;
@Override
protected void onPreExecute() {
super.onPreExecute();
}
@Override
protected Void doInBackground(Void... params) {
try {
String myURL = "http://site.ru";
String parammetrs = "login=1&password=2";
byte[] data = null;
InputStream is = null;
try {
URL url = new URL(myURL);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setDoOutput(true);
conn.setDoInput(true);
conn.setRequestProperty("Content-Length", "" + Integer.toString(parammetrs.getBytes().length));
OutputStream os = conn.getOutputStream();
data = parammetrs.getBytes("UTF-8");
os.write(data);
data = null;
conn.connect();
int responseCode= conn.getResponseCode();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
if (responseCode == 200) {
is = conn.getInputStream();
byte[] buffer = new byte[8192];
int bytesRead;
while ((bytesRead = is.read(buffer)) != -1) {
baos.write(buffer, 0, bytesRead);
}
data = baos.toByteArray();
resultString = new String(data, "UTF-8");
}
} catch (IOException e) {
//resultString = "IOException:" + e.getMessage();
} catch (Exception e) {
//resultString = "Exception:" + e.getMessage();
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(Void result) {
super.onPostExecute(result);
if(resultString != null) {
Toast toast = Toast.makeText(getApplicationContext(), resultString, Toast.LENGTH_SHORT);
toast.show();
}
}
}
}