Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add iterator for container #4

Open
wants to merge 1 commit into from

1 participant

@honzap

I've added iterator to container. I use it in phone, e-mail... list where an add button is at last row.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 18, 2011
  1. add iterator to begin container

    Jan Pecek authored
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 FormMacros.php
View
4 FormMacros.php
@@ -162,10 +162,10 @@ public static function inputValue($name, $modifiers = array()) {
public static function macroBeginDynamicContainer($content) {
list($name) = self::fetchNameAndModifiers($content);
- return '$dynamicContainers = Addons\Forms\FormMacros::getControl('.$name.')->getComponents(); Addons\Forms\FormMacros::beginContainer('.$name.'); foreach($dynamicContainers as $dynamicContainerName => $dynamicContainer): Addons\Forms\FormMacros::beginContainer($dynamicContainerName);';
+ return '$dynamicContainers = Addons\Forms\FormMacros::getControl('.$name.')->getComponents(); Addons\Forms\FormMacros::beginContainer('.$name.'); foreach($iterator = $_l->its[] = new Nette\SmartCachingIterator($dynamicContainers) as $dynamicContainerName => $dynamicContainer): Addons\Forms\FormMacros::beginContainer($dynamicContainerName);';
}
public static function macroEndDynamicContainer($content) {
- return "Addons\Forms\FormMacros::endContainer(); endforeach; Addons\Forms\FormMacros::endContainer();";
+ return 'Addons\Forms\FormMacros::endContainer(); endforeach; array_pop($_l->its); $iterator = end($_l->its); Addons\Forms\FormMacros::endContainer();';
}
// </editor-fold>
Something went wrong with that request. Please try again.