This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// form event field | |
onFieldChange = e => { | |
this.setState({ [e.target.name]: e.target.value }); | |
}; | |
// form event Object property | |
onPropertyChange = e => { | |
this.setState({ | |
[e.target.dataset.model]: { | |
...this.state[e.target.dataset.model], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
namespace App\Middleware; | |
use Psr\Http\Message\ResponseInterface; | |
use Psr\Http\Message\ServerRequestInterface; | |
use Psr\Http\Server\MiddlewareInterface; | |
use Psr\Http\Server\RequestHandlerInterface; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("form").submit(function (e) { | |
if (confirm("Bla bla")) { | |
} else { | |
e.preventDefault(e); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$translation = $this->Translations->patchEntity($translation, $this->request->data, [ | |
'validate' => false, | |
'associated' => ['SentenceTranslations' => ['accessibleFields' => ['id' => true]]] | |
]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<nav aria-label="Page navigation"> | |
<ul class="pagination"> | |
<?php | |
$this->Paginator->templates([ | |
'prevActive' => '<li class="page-item"><a class="page-link" href="{{url}}">{{text}}</a></li>' | |
]); | |
$this->Paginator->templates([ | |
'prevDisabled' => '<li class="page-item disabled"><a class="page-link" href="{{url}}">{{text}}</a></li>' | |
]); | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$this->viewBuilder()->layout('trans'); | |
$source = $this->Sources->newEntity(); | |
if ($this->request->is('post')) { | |
$source->path = md5(Time::now()) . '.srt'; | |
$file = new File($this->request->data['file']['tmp_name']); | |
$file->copy(WWW_ROOT . 'files' . DS . $source->path); | |
$source->title = $this->request->data['title']; | |
$source->user_id = $this->Auth->user('id'); | |
$this->Sources->save($source); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ExamplesUsersTable extends Table | |
{ | |
public function initialize(array $config) | |
{ | |
parent::initialize($config); | |
$this->table('examples_users'); | |
$this->displayField('id'); | |
$this->primaryKey('id'); |
NewerOlder