I used this script to make a query from this items/show.php
$db = $this->getDb();
$stmt = $db->query("SELECT * FROM tb_oauth WHERE id_oauth = 'box_sandbox'");
$OAUTH = (array)$stmt->fetchObject();
I used this script to make a query from this items/show.php
$db = $this->getDb();
$stmt = $db->query("SELECT * FROM tb_oauth WHERE id_oauth = 'box_sandbox'");
$OAUTH = (array)$stmt->fetchObject();
but it returns some error like this:
Zend_Loader_PluginLoader_Exception
Plugin by name 'GetDb' was not found in the registry; used paths:
ExhibitBuilder_View_Helper_: /chroot/home/devpinal/dev.pinalerts.com/html/omeka/plugins/ExhibitBuilder/views/helpers/
Omeka_View_Helper_: /chroot/home/devpinal/dev.pinalerts.com/html/omeka/application/views/helpers/
Zend_View_Helper_: Zend/View/Helper/
help me please..
ouch... i found the answer.. :) thanks, i just found the answer after read this forum.. :)
Hi
So give your answer...
Technically, you can use database query from theme, but this is not recommended. Omeka and Zend follow the MVC (model-view-controller) architecture, so in theme (view), you should just apply a display to data you get from the controller. So this query should be done in a specific plugin.
Sincerely,
Daniel Berthereau
Infodoc & Knowledge management