Nette Framework 2.3.7 released
- David Grudl
- Nette Core | 8228
Nette Framework 2.3.7 has just been released.
„Did you mean?“ feature
- Database Row, ActiveRow: shows suggestions for undeclared columns
- Tracy: shows suggestions for some errors and notices (see)
- Nette\Object: suggestions for undeclared methods and properties (see)
- Latte: missing macros and filters
- component Container: shows suggestions for missing components
Application
- RoutingPanel: redesign, added HTTP method
- Presenter: better exception messages
PresenterComponentReflection::convertType()
support for all built-in PHP typehintsPresenterComponentReflection::convertType()
converts NULL to appropriate type- added Nette\Application\Responses\CallbackResponse
- ErrorPresenter: returns CallbackResponse
- removed rarely used
@property
phpDoc
Database
- Selection: Fixed infinite loop when accessing to deleted row
- SqlsrvDriver: support for limit and offset on SQL Server 2012
- drivers: fixed applyLimit for $limit = 0
- drivers:
applyLimit()
throws exception for negative values (but not when you usepage()
) - Selection: fixed bug with zero in primary key
- Selection: referenced cache cleared only for root selection (not in GroupedSelection)
- SqlsrvDriver::
applyLimit()
: supports keywords DISTINCT and ALL after SELECT - SqlBuilder: removed “AS” keyword in JOINs
- Structure: added columns analyze for views
DI
- ContainerBuilder: added support for PHP7 type hints
- DecoratorExtension: implemented decorating by factory interface
- PhpExtension: NULLs are skipped.
- NeonAdapter: fixed
dump()
for data with simple Nette\DI\Statement
Forms
- CheckboxList: added containerPrototype and itemLabelPrototype
- FormMacros: added warnings Modifiers are not allowed here
- Form::$onSuccess and Container::$onValidate must be array or Traversable
- netteForms: updated regexp for URL and email validation
- Message: propagates links target from HTML message to plaintext version
PhpGenerator
- added support for anonymous classes
- Method, Parameter: added support for PHP 7 type hints
- Method, Parameter, Property: added constructors
- PhpNamespace::
unresolveName()
supports for built-in types and PHP 7 types
Tracy
- Debugger::
barDump()
dumps basic location by default - Helpers::
editorLink()
improved way how file names are shortened - Logger: fixed severity in
formatMessage()
- fixes for PHP 7, added new examples
Latte
- added warnings: Modifiers are not allowed here
- BlockMacros: fixed trimming of block
- BlockMacros: fixed child template without block
- Parser: fixed substr_count() error on empty string
Utils
- Random: use
random_int()
on PHP 7 - Random: charlist now contains only unique characters
- Random: rejects openssl_random_pseudo_bytes result when it is not cryptographically strong
- Image: fixed color allocation in palette-based images
- ObjectMixin: added
getExtensionMethods()
- ObjectMixin: added warning when method-getter is used by mistake (for getters without parameters) (BC break) See note.
Sandbox
- Error & Error4xx presenters
For the details you can have a look at: application, component-model, database + previous, di, forms, mail, php-generator + previous, utils + previous, latte, tracy.
- radas
- Member | 225
David, thank you for your great work!
But I think, there is an BC break in Forms – “CheckboxList: added
containerPrototype and itemLabelPrototype”.
Nette 2.3.5 (nette/forms 2.3.4):
$regions = $container->addCheckboxList('regions', NULL, $this->regionsList);
$regions->setDefaultValue($this->regions)
->getSeparatorPrototype()
->setName(NULL);
$regions->getLabelPrototype()
->setClass('checkbox-inline');
//dump($regions->getLabelPrototype());
/*
Nette\Utils\Html #08ec
name private => "label" (5)
isEmpty private => FALSE
attrs => array ()
children protected => array ()
*/
//dump($regions->getItemLabelPrototype());
/*
Nette\Utils\Html #8e27
name private => ""
isEmpty private => FALSE
attrs => array (1)
class => "checkbox-inline" (15)
children protected => array ()
*/
produces
<label class="checkbox-inline">
Nette 2.3.7 (nette/forms 2.3.5):
produces only
<label>
I have to use the new method getItemLabelPrototype() to generate class=“checkbox-inline”.
Last edited by radas (2015-10-15 09:57)
- David Grudl
- Nette Core | 8228
Damn, I didn't realized, that this is BC break, because this was not. I'll fix it.
- w3r0
- Member | 4
Why did you add warning “Modifiers are not allowed here”? I want to use “filtered” variable in condition?
I have something like this:
{var $replacedEmail = $code|replaceEmail;}
{if !empty($replacedEmail)}
{$replacedEmail}
{/if}
Can you explain me how I can resolved this? Thank you :)
- David Grudl
- Nette Core | 8228
@w3r0 Because this has never worked.
{var $replacedEmail = $code|replaceEmail}
is exactly the same as
{var $replacedEmail = $code}
; modifier is not processed here.
Previously was modifier ignored, now Latte warns you.
Syntax {var $replacedEmail = $code|replaceEmail}
will be
supported in next major release of Latte.
- David Matějka
- Moderator | 6445
@w3r0 Currently you can use
{var $replacedEmail = $template->replaceEmail($code)}