Пример #1
0
 public static function register()
 {
     if (!self::$registered) {
         Form::extensionMethod('addIntegerPicker', __NAMESPACE__ . '\\IntegerPicker::addIntegerPicker');
         self::$registered = true;
     }
 }
<?php

namespace App\Presenters;

use Nette, Nette\Application\Application, Nette\Utils\Arrays, Nette\Utils\Finder, Nette\Http\Request, Nette\Utils\Image, Nette\Utils\Strings, Nette\Application\UI\Form, Nette\Forms\Controls, Nette\Caching\Cache;
Nette\Application\UI\Form::extensionMethod('addMultiUpload', function (\Nette\Application\UI\Form $form, $name, $label = NULL) {
    $form[$name] = new \Nette\Forms\Controls\MultiUploadControl($label);
    return $form[$name];
});
class FotogaleriePresenter extends Nette\Application\UI\Presenter
{
    /** @var Nette\Database\Context */
    private $database;
    public $images;
    public $fileUrl;
    public $imgStranka;
    public $totalPosts;
    const GAL_PATH = 'gallery/';
    const PO = 6;
    //pocet oobrazku na stranku
    public function __construct(Nette\Database\Context $database)
    {
        $this->database = $database;
    }
    public function checkDir($fileUrl)
    {
        if (file_exists($fileUrl)) {
            $this->flashMessage('Toto Album již existuje.', 'alert-danger');
            return false;
        } else {
            $this->flashMessage('Album bylo úspěšně vytvořeno.', 'alert-success');
Пример #3
0
 public function __construct($parent = null, $name = null)
 {
     parent::__construct($parent, $name);
     Form::extensionMethod('addIntegerPicker', function (Form $form) {
     });
 }