How to execute a Stored Procedure Oracle with ZF2

I was some problems to execute an oracle stored procedure in ZF2 with out params.

The following is an example, how finally I implemented the solution.


CREATE OR REPLACE procedure sp_tmp(rtn out char) AS

rtn := '1';

end sp_tmp;

 Call from ZF2 Model

        $adapter = $this->tableGateway->adapter;
        $statement = $adapter->createStatement();
        $statement->prepare("begin sp_tmp(:output); end;");

        $parameterContainer = new \Zend\Db\Adapter\ParameterContainer;
        //Uncomment this if you want to add IN params
        //$parameterContainer->offsetSet('inParam', '', $parameterContainer::TYPE_STRING); 
        $parameterContainer->offsetSetReference('output', 'output'); // Out parameter


 Finally I got this:

array (size=1)
  'output' => &string '1' (length=1)

Compartir variables en Controladores con AngularJS

Para compartir variables en controladores con AngularJS:


MiWeb.factory('Data', function () {
    return { Nombre: '' };

MiWeb.controller('IndexCtrl', function ($scope, Data) {
    $scope.Data = Data;

MiWeb.controller('PanelCtrl', function ($scope, Data) {
    $scope.Data = Data;


<div ng-controller="IndexCtrl">
    <input type="text" ng-model="Data.Nombre">
    <br>Mi nombre es : <strong>{{Data.Nombre}}</strong>


<div ng-controller="PanelCtrl">
    El nombre ingresado en el controlador index es: {{Data.Nombre}}