Help needed for owncloud app

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Help needed for owncloud app

Nils Pöhlmann-2

I posted this thread:
and was told, that it would be a better choice to join this mailing list.
Since this problem changed a little, here the update:

I'm still at the beginning of the template, but somehow it's partly
working now. I'm not sure, what I actually changed, but never mind.
So the problem that needs to be resolved is this:
I want to be able to access an array from within my template file, for
that I use in the controller file following code:
function index(){
         $query = \OCP\DB::prepare("SELECT * FROM *PREFIX*msg WHERE

         $results = $query->execute(array(USER::getUser()));

         $message = $results->fetchAll();
         $response = new TemplateResponse($this->api, 'main');
         $params = array('messages' => $message,
                 'msg' => "hallo sch welt...");
         return $response;

(including all necessary Libraries and index part of an object called
PageController, which extends Controller -> like in the Tutorial of

Now I try to access these by doing:
foreach ($_["messages"] as $msg){
in my main.php (in template folder)

I'm expecting the output "array" and "somevalue" from my database, but
instead nothings shows up. No errors are being logged, so what am I missing?

Nils Pöhlmann
Devel mailing list
[hidden email]