View new-element.js
// <a style="color: red;" onclick="..." href="https://phpfashion.com">blogísek</a>
var $el = $('<a>', {
href: url,
text: title,
click: function(e) {
alert(this.href);
},
css: {
color: 'red'
}
View control-presenter.php
class PollControl extends Control
{
public function __construct(array $info)
{
$this->info = $info;
}
}
interface IPollControlFactory
{
/**
View control.php
<?php
namespace App\FrontModule\Components;
use Nette\Application\UI,
Nette,
Nette\Mail\Message,
Nette\Mail\SendmailMailer,
App,
CardBook;
View BasePresenter.php
<?php
/**
* @author Filip Procházka <filip@prochazka.su>
*/
abstract class BasePresenter extends Nette\Application\UI\Presenter
{
/**
* @var \Img\ImagePipe
View caret.js
jQuery.fn.extend({
insertAtCaret: function(myValue){
return this.each(function(i) {
if (document.selection) {
//For browsers like Internet Explorer
this.focus();
sel = document.selection.createRange();
sel.text = myValue;
this.focus();
View nette.php
<?php
$cnew->addText("input1", "Jméno 1")->addRule(
function ($item, $arg){
return $item->value == "ano";
}
, 'Číslo musí být dělitelné %d.', 8);
View trigger.html
<form id="msgbox" action="#" method="get">
<fieldset>
<label for="msg">your message</label>
<input id="msg" value="" />
<button>SEND</button>
</fieldset>
</form>
View image-with-caption.js
$(".img-left, .img-right, .article-detail img", this).each(function()
{
var image = $(this);
var imageCaption = image.attr("alt");
if (imageCaption != '')
{
image.wrap('<div class="image-w-caption">');
image.parent('.image-w-caption')
.css('max-width', image.width())
.addClass(image.attr('class'))
View bootstrap-mixins.scss
@mixin respond($minWidth: 0, $maxWidth: 0) {
@if $minWidth and $maxWidth
{
@media screen and (min-width: $minWidth) and (max-width: $maxWidth) { @content; }
}
@else if $minWidth
{
@media screen and (min-width: $minWidth) { @content; }
}
@else if $maxWidth
View update-join.sql
UPDATE table A
JOIN table B ON {join fields}
JOIN table C ON {join fields}
JOIN {as many tables as you need}
SET A.column = {expression}
Example:
UPDATE person P
JOIN address A ON P.home_address_id = A.id
JOIN city C ON A.city_id = C.id