当前位置: 首页>>代码示例>>PHP>>正文


PHP PhpRenderer::placeholder方法代码示例

本文整理汇总了PHP中Zend\View\Renderer\PhpRenderer::placeholder方法的典型用法代码示例。如果您正苦于以下问题:PHP PhpRenderer::placeholder方法的具体用法?PHP PhpRenderer::placeholder怎么用?PHP PhpRenderer::placeholder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend\View\Renderer\PhpRenderer的用法示例。


在下文中一共展示了PhpRenderer::placeholder方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: render

 /** {@inheritdoc} */
 public function render(\Zend\View\Renderer\PhpRenderer $view)
 {
     $view->placeholder('BodyOnLoad')->append('document.forms["form_login"]["User"].focus()');
     return parent::render($view);
 }
开发者ID:hschletz,项目名称:braintacle,代码行数:6,代码来源:Login.php

示例2: render

    /** {@inheritdoc} */
    public function render(\Zend\View\Renderer\PhpRenderer $view)
    {
        $commandLine = $view->translate('Command line');
        $labels = array('launch' => $commandLine, 'execute' => $commandLine, 'store' => $view->translate('Target Path'));
        $labels = '    var actionParamLabels = ' . json_encode($labels) . ";\n";
        $view->headScript()->captureStart();
        print $labels;
        ?>

        /**
         * Hide or display a block element.
         */
        function display(name, display)
        {
            document.getElementsByName(name)[0].parentNode.style.display = display ? 'table-row' : 'none';
        }

        /*
         * Event handler for Platform combobox. Also called for form
         * initialization. Hides/displays notification elements which have no
         * effect on non-Windows platforms.
         */
        function changePlatform()
        {
            if (document.getElementById('form_package_build_platform').value == 'windows') {
                display('Warn', true);
                display('PostInstMessage', true);
                toggleWarn();
            } else {
                display('Warn', false);
                display('WarnMessage', false);
                display('WarnCountdown', false);
                display('WarnAllowAbort', false);
                display('WarnAllowDelay', false);
                display('PostInstMessage', false);
            }
        }

        /*
         * Event handler for Action combobox. Also called for form initialization.
         * Changes label of parameter input field according to selected action.
         */
        function changeParam()
        {
            var label = actionParamLabels[document.getElementsByName('DeployAction')[0].value];
            document.getElementsByName('ActionParam')[0].parentNode.getElementsByTagName('span')[0].innerHTML = label;
        }

        /*
         * Event handler for Warn checkbox. Also called for form initialization.
         * Hides or displays Warn* fields according to checked state.
         */
        function toggleWarn()
        {
            var checked = document.getElementById('form_package_build_warn').checked &&
                          document.getElementById('form_package_build_platform').value == 'windows';
            display('WarnMessage', checked);
            display('WarnCountdown', checked);
            display('WarnAllowAbort', checked);
            display('WarnAllowDelay', checked);
        }

        <?php 
        $view->headScript()->captureEnd();
        $view->placeholder('BodyOnLoad')->append('changePlatform()');
        $view->placeholder('BodyOnLoad')->append('changeParam()');
        $view->placeholder('BodyOnLoad')->append('toggleWarn()');
        $view->placeholder('BodyOnLoad')->append('document.getElementsByName("Name")[0].focus()');
        return parent::render($view);
    }
开发者ID:hschletz,项目名称:braintacle,代码行数:71,代码来源:Build.php

示例3: render

    /** {@inheritdoc} */
    public function render(\Zend\View\Renderer\PhpRenderer $view)
    {
        $view->headScript()->captureStart();
        ?>

        /**
         * Show/hide elements according to selected "Where" radio button
         */
        function selectElements()
        {
            var buttons = document.getElementsByName('Where');
            var newGroup;
            for (var i = 0; i < buttons.length; i++) {
                if (buttons[i].value == 'new') {
                    newGroup = buttons[i].checked;
                    break;
                }
            }
            if (newGroup) {
                display('NewGroup', true);
                display('Description', true);
                display('ExistingGroup', false);
            } else {
                display('NewGroup', false);
                display('Description', false);
                display('ExistingGroup', true);
            }
            var errors = document.getElementsByClassName('error');
            for (i = 0; i < errors.length; i++) {
                errors[i].style.display = newGroup ? 'block' : 'none';
            }
        }

        /**
         * Hide or show a form element
         *
         * name (string): element name
         * show (bool): true to show, false to hide
         */
        function display(name, show)
        {
            document.getElementsByName(name)[0].parentNode.style.display = show ? 'table-row' : 'none';
        }

        <?php 
        $view->headScript()->captureEnd();
        $view->placeholder('BodyOnLoad')->append('selectElements()');
        return parent::render($view);
    }
开发者ID:hschletz,项目名称:braintacle,代码行数:50,代码来源:AddToGroup.php

示例4: render

    /** {@inheritdoc} */
    public function render(\Zend\View\Renderer\PhpRenderer $view)
    {
        $view->headScript()->captureStart();
        ?>

        // Hide or show all label elements following the checkbox within the same fieldset
        function toggle(element)
        {
            var node = element.parentNode.parentNode;
            while (node = node.nextSibling) {
                switch (node.nodeName) {
                    case 'LABEL':
                        node.style.display = element.checked ? 'table-row' : 'none';
                        break;
                    case 'UL':
                        node.style.display = element.checked ? 'block' : 'none';
                        break;
                    default:
                        // Invisible text node, nothing to be changed
                }
            }
        }

        // Initialize display of fieldset content
        function toggleByName(name)
        {
            var elements = document.getElementsByName(name);
            for (var i = elements.length - 1; i >= 0; i--) {
                if (elements[i].type == 'checkbox') {
                    toggle(elements[i]);
                    break;
                }
            }
        }

        <?php 
        $view->headScript()->captureEnd();
        $view->placeholder('BodyOnLoad')->append('toggleByName("Download[packageDeployment]")');
        $view->placeholder('BodyOnLoad')->append('toggleByName("Scan[allowScan]")');
        return parent::render($view);
    }
开发者ID:hschletz,项目名称:braintacle,代码行数:42,代码来源:ClientConfig.php

示例5: render

    /**
     * Render form
     *
     * @param \Zend\View\Renderer\PhpRenderer $view
     * @return string
     */
    public function render(\Zend\View\Renderer\PhpRenderer $view)
    {
        $view->headScript()->captureStart();
        ?>

        // Filter types
        var types = <?php 
        print json_encode($this->_types);
        ?>
;

        /**
         * Event handler for Filter combobox
         *
         * Sets options for "operators" element according to selected filter.
         */
        function filterChanged()
        {
            var elements = document.getElementById('form_search').elements;
            var operators;
            switch (types[elements['filter'].value]) {
                case 'integer':
                case 'float':
                case 'date':
                    operators = <?php 
        print json_encode($this->_operatorsOrdinal);
        ?>
;
                    break;
                default:
                    operators = <?php 
        print json_encode($this->_operatorsText);
        ?>
;
            }
            var options = elements['operator'].options;
            options.length = 0;
            for (var value in operators) {
                options.add(new Option(operators[value], value));
            }
        }

        <?php 
        $view->headScript()->captureEnd();
        $onload = $view->placeholder('BodyOnLoad');
        $onload->append('filterChanged()');
        // Set operator value manually because the element creation code does
        // not know it's valid and ignores it.
        $initialOperator = $this->get('operator')->getValue();
        if ($initialOperator) {
            $onload->append(sprintf('document.getElementById("form_search").elements["operator"].value = %s', json_encode($initialOperator)));
        }
        return parent::render($view);
    }
开发者ID:hschletz,项目名称:braintacle,代码行数:60,代码来源:Search.php


注:本文中的Zend\View\Renderer\PhpRenderer::placeholder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。