This forum has moved to a new location and is in read-only mode. Please visit to access the new location.


I'm modifying the OctoCase plugin and I'm wanting to add some ajax functionality to it.

I've added an AJAX handler to the components\Items.php

public function onPortfolioItemClick()
    $this['result'] = "This is the result";

I've added the Items component to a page as following:

{% component 'octocaseItems' %}

Below I added a little test using the AJAX Data attributes API:

<form data-request="octocaseItems::onPortfolioItemClick" data-request-update="ajaxResult: '#result'">
    <input type="submit" value="Calculate">
<div id="#result"></div>

ajaxResult partial is as simple as This is the result: {{ result }}

But when I click the submit button, I see the ajax loading bar on top but then a dialog appears saying: Cannot use object of type \OctoDevel\OctoCase\Components\Items as array

What am I missing?


Does anyone ever answer any support threads here?


maybe you should try to convert it to array?

$items = Items::all(); return $items->toArray();

1-3 of 3

You cannot edit posts or make replies: the forum has moved to