Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paginator rendering problem in ZfcTwig 1.2 #102

Open
chocochaos opened this issue Oct 15, 2014 · 10 comments
Open

Paginator rendering problem in ZfcTwig 1.2 #102

chocochaos opened this issue Oct 15, 2014 · 10 comments

Comments

@chocochaos
Copy link

Pagination controls worked fine with ZfcTwig 1.1.5. However, when I update to ZfcTwig 1.2.0 or higher the partial template appears not to be rendering any more.

Code in the template to invoke the pagination control:

    {{ paginationControl(data, 'sliding', {0 : 'partial/paginator.twig', 1 : 'Logboek'}, {'route' : 'logboek', 'orderBy' : orderBy, 'order' : order}) }}

In partial/paginator.twig:

    {% if pageCount %}
        <div class="pagination">
            {% if previous is defined %}
                <a href="{{ url(route, {'entity' : entity, 'order_by' : orderBy, 'order' : order, 'page' : previous}) }}"
                   class="prev">&laquo;
                    vorige pagina</a>
            {% endif %}
            {% for page in pagesInRange %}
                {% if page != current %}
                    <a href="{{ url(route, {'entity' : entity, 'order_by' : orderBy, 'order' : order, 'page' : page}) }}">{{ page }}</a>
                {% else %}
                    <a class="active">{{ page }}</a>
                {% endif %}
            {% endfor %}
            {% if next is defined %}
                <a href="{{ url(route, {'entity' : entity, 'order_by' : orderBy, 'order' : order, 'page' : next}) }}"
                   class="prev">volgende
                    pagina &raquo;</a>
            {% endif %}
        </div>
    {% endif %}

This is what it looks like with ZfcTwig 1.1.5:
zfctwig 1 1 5

This is what it looks like with ZfcTwig 1.2.0:
zfctwig 1 2 0

I have tried these tests with several versions of twig and zend framework, none seem to work properly with ZfcTwig 1.2.0.

@boosis
Copy link

boosis commented Nov 29, 2014

+1

3 similar comments
@hwsdien
Copy link

hwsdien commented Dec 4, 2014

+1

@AdamiecRadek
Copy link

+1

@AGmakonts
Copy link

+1

@merlinus1
Copy link

Try adding invokables declaration:

'zfctwig' => [
        'helper_manager' => [
            'configs' => [
                'Zend\Navigation\View\HelperConfig',
            ],
            'invokables' => [
                'partial'  => 'Zend\View\Helper\Partial',
            ]
        ],
]

@saadhre
Copy link

saadhre commented Jan 28, 2015

@merlinus1 Thank you for tip! Works.

@saadhre
Copy link

saadhre commented May 15, 2015

Solution from @merlinus1 not working anymore.

Anyone with problem try this:

'zfctwig' => [
    'helper_manager' => [
        'invokables' => [
            'paginationControl'  => 'Zend\View\Helper\PaginationControl',
        ],
    ],
],

@pensiero
Copy link

@saadhre this is the correct config:

    'helper_manager' => [
        'invokables' => [
            'partial'  => 'Zend\View\Helper\Partial',
            'paginationControl'  => 'Zend\View\Helper\PaginationControl',
        ]
    ],

@saadhre
Copy link

saadhre commented May 22, 2015

@gamempire Strange, I have partial helper loaded by default...

@pensiero
Copy link

I don't know, without that I receive the error 'can't find template...'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants