Skip to content

Instantly share code, notes, and snippets.

View matej21's full-sized avatar

David Matějka matej21

View GitHub Profile
public function createComponentFoo(IBar $fooFactory){
return $fooFactory->create();
}
<?php
public function createComponent($name)
{
$ucname = ucfirst($name);
$method = 'createComponent' . $ucname;
if ($ucname !== $name && method_exists($this, $method)) {
$reflection = $this->getReflection()->getMethod($method);
if($reflection->getName() !== $method) {
return;
}
<?php
use Nette\Application\UI\Presenter;
class TemplateFactory extends \Nette\Object
{
/**
* @var \Nette\DI\Container
*/
protected $container;
<?php
class ImageResponse extends \Nette\Object implements \Nette\Application\IResponse
{
/** @var \Nette\Image|string */
private $image;
/**
* @param \Nette\Image|string
<?php
class ContentResponse extends \Nette\Object implements \Nette\Application\IResponse
{
protected $forDownload = FALSE;
/** @var string */
private $file;
/** @var string */
<?php
use Nette\Application\IRouter;
use Nette\Application\UI\InvalidLinkException;
use Nette\Application\UI\Presenter;
use Nette\Application;
use Nette\Http\Url;
use Nette\Object;
/**
<?php
/**
* Nette Framework Extras
*
* This source file is subject to the New BSD License.
* @copyright Copyright (c) 2009 David Grudl
* @license New BSD License
*/
<?php
/**
* @author David Matejka
*/
class Identity extends \Nette\Object implements \Nette\Security\IIdentity
{
/** @var int */
protected $id;
<?php
class MyAuthenticator extends Nette\Object implements IAuthenticator
{
/** @var array */
private $userlist;
/**
* @param array list of pairs username => password
*/
<?php
use Nette\Http\Request;
class RefUrlFactory extends Object
{
/** @var \Nette\Http\Url */
protected $fallbackUrl;
/** @var \Nette\Http\Request */