php - Phalcon - Micro App - Run executeQuery in a custom function -


i have followed api tutorial. http://docs.phalconphp.com/en/latest/reference/tutorial-rest.html

i have working.

now creating authentication function call @ beginning of each api call.

example:

$app->get('/api/robots', function() use ($app) { $authdata=isauthorized($app); ... ..

so in "index.php" file have function titled "is_authorized"

the function runs fine, cannot execute sql within function.

the following example not execute within is_authorized function.

$phql = "select * members order id"; $robots = $app->modelsmanager->executequery($phql);

while above run within initial api call function not run in is_authorized function. there way pass "$app" function can use execute queries?

this issue unrelated phalcon , more of issue understanding of how pass reference in php 5.4.

see post reason on why running issue.

php 5.4 call-time pass-by-reference - easy fix available?


Comments

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

c# - Avoiding duplicate methods for Task and Task<T> -

javascript - Which segment of a polyline was clicked? -