rcrowe / fuel-pjax

Easily support PJAX requests with FuelPHP
9 stars 3 forks source link

Any way to avoid breaking templates? #1

Closed AlexBrandes closed 11 years ago

AlexBrandes commented 11 years ago

First of all thanks rcrowe for releasing this.

One problem I'm having is that setting the package to autoload breaks any controllers extending the Controller_Template class. The $this->template object is returned as null to the controller.

Templates would be an ideal way to use pjax, for instance wrapping main content with {# PJAX #} so that a full page is returned if called directly or just the content if called with pjax.

Anything I can do to fix templates?

rcrowe commented 11 years ago

Sorry about that, I never used Controller_Template and haven't used this for a while now so don't have a quick fix for you. However, should be able to take a look at this over the next couple of days.

Let us know if you managed to get it working (pull request)

AlexBrandes commented 11 years ago

I appreciate you taking a look at it.

I wasn't able to figure this out and went with a workaround instead to replicate the template concept with views included in views. I'm loving how easy the pjax extension and your fuelphp package are making things for me though, working on a continuous play music app.

I think the view is being returned as a string before the template object can get a hold of it.

rcrowe commented 11 years ago

Should have a fix for this shortly, nearly got it working on my local

rcrowe commented 11 years ago

Pushed a stab at it to the template branch (https://github.com/rcrowe/fuel-pjax/tree/template)

If you could test this that would be great.

AlexBrandes commented 11 years ago

Seems to be working with the exception that the {# pjax #} tags weren't being stripped for non-pjax requests. I added a couple lines of code and added a pull request.

rcrowe commented 11 years ago

Just merged this into master