`$pdo = new \PDO('odbc:MYMSSQL', 'myusername', 'mypass'); $pdostmt = $pdo->prepare('SELECT TOP 10 FROM dbo.MyTableName'); if (!$pdostmt) { throw new Exception('There was an error'); } if (false === $pdostmt->execute()) { throw new Exception('The pdo statement did not execute successfully'); }
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
<ul class="breadcrumb"> | |
<?php $lastPageKey = count($this->pages) - 1?> | |
<?php var_dump($this->pages) //blank page?> | |
<?php foreach ($this->pages as $key => $page): // iterate through the pages?> | |
<li><?php get_class($pages) //error, expects object array given?></li> | |
<li> | |
<?php if ($key < $lastPageKey): // if this isn't the last page, add a link and the separator?> | |
<a href="<?= $page->getHref() ?>"><?= $page->getLabel() ?></a> | |
<span class="divider">/</span> | |
<?php else: // otherwise, just output the name ?> |
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 Zend\Navigation\AbstractContainer | |
... | |
public function getActiveBranch() | |
{ | |
$found = array(); | |
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
<ul class="breadcrumb"> | |
<?php | |
function getActive(array $level) { | |
$activeInLevel = array_filter($level, function ($page) { | |
return $page->isActive(true); | |
}); | |
return $activeInLevel[0]; | |
}?> | |
<?php $p = $this->pages ?> | |
<?php $active = getActive($p); echo get_class($active); ?> |
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 | |
public function getSqlDeclaration(array $fieldDeclaration, AbstractPlatform $platform) | |
{ | |
$values = array_map(function($val) { | |
return "'".$val."'"; | |
}, $this->values); | |
return "ENUM(".implode(", ", $values).") COMMENT '(DC2Type:".$this->name.")'"; | |
} |
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 | |
use Gbili\Miner\BluePrint, | |
Gbili\Miner\BluePrint\Action\Extract\Savable as ExtractSavable, | |
Gbili\Miner\BluePrint\Action\GetContents\Savable as GetContentsSavable, | |
Gbili\Vid\Savable\Lexer; | |
$a = array();//actions | |
$b = new BluePrint\Savable(); | |
$b->setHost('myhost.com'); | |
$b->setBasePath('./../'); |
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
function print() { | |
const filename = 'ThisIsYourPDFFilename.pdf'; | |
html2canvas(document.querySelector('#nodeToRenderAsPDF')).then(canvas => { | |
let pdf = new jsPDF('p', 'mm', 'a4'); | |
pdf.addImage(canvas.toDataURL('image/png'), 'PNG', 0, 0, 211, 298); | |
pdf.save(filename); | |
}); | |
} |
OlderNewer