omda12 / akelosframework

Automatically exported from code.google.com/p/akelosframework
GNU Lesser General Public License v2.1
0 stars 0 forks source link

renderPartialCollection has no helper #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In the controller, '$this->proj_list' is a return from an
ActiveRecord::find('all')

in the view template :
<?= $controller->renderPartialCollection('rights', $proj_list) ?>

Doing this does iterates through $proj_list and correctly assigns the
$rights variable corresponding to the current $proj_list entry.

But absolutely no $*_helper is defined.
- $text_helper
- $form_options_helper
- etc.

As always, using MAMP Pro, and the lastest revision of Akelos...

Original issue reported on code.google.com by dracogni...@gmail.com on 3 Mar 2007 at 7:27

GoogleCodeExporter commented 9 years ago
I didn't have time to go around this so you might want to dig yourself if 
you're in a
hurry.

Check AkActionView::renderTemplate a and AkActionController::instantiateHelpers

Don't mess around on AkActionView::_loadHelpers as it's not used anywhere 

Original comment by bermifer...@gmail.com on 4 Mar 2007 at 6:06

GoogleCodeExporter commented 9 years ago
Here's the patch.

It was hard to find, but finally, really easy to patch.

The thing is that I was looking into the AkActionView.php, while I should have 
looked
into AkActionController.php.

In fact, I found, by testing many different things, that even renderPartial had 
a
problem.

It called AkActionView::renderPartial with 3 params, while
AkActionView::renderPartial only receives 2.
I then understood that the $local_assigns were in fact the $object variable, 
refered
to $this, meaning that it was not possible to assign local variables...
I patched this.

Plus, I finally patched my problem in renderPartialCollection, by merging
$local_assigns with $this =)

I hope this is how it is supposed to be. At least it works for me =D

Original comment by dracogni...@gmail.com on 4 Mar 2007 at 5:14

Attachments:

GoogleCodeExporter commented 9 years ago
Ooops. Sorry, I sent an old version of the diff.

Here's the correct one :p

Original comment by dracogni...@gmail.com on 4 Mar 2007 at 5:47

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by bermifer...@gmail.com on 11 Mar 2007 at 1:10