zend framework2 - PHP add function to array without executing -


My project is working with the automatic code generator and the Zend Framework for file / class / method reflection IM using 2 need to add the elements in the array went back to me:

  public function getServiceConfig () {return array ( 'factories' = & gt; array (' album \ models \ AlbumTable '= & gt; function (get $ sm $ {$ TableGateway = $ sm- & gt; (' albumtable gateway '); $ table = new album tab ($ tablegateway); return $ Alika;} 'Albmteblgetve =' => function ($ sm) {$ dbAdapter = $ sm - & gt; Get ( 'Zend \ Db \ Adapter \ Adapter'); $ resultSetPrototype = new ResultSet (); $ resultSetPrototype- & gt; Setareobjektprototaip (new album ()); new Teblget ( 'Album', $ dbAdapter, null, $ result prototype);},),);}  

I 'factories' Get the array but can not add new element (work) (I need to add new element to factories like "objectTableGateway '=> function ($ sm) {...}" body = I write var_export (array, true);

  1. If I only execute the function - function;
  2. If I add to the quote - I need a clean quote manually after writing the code.

How to solve this problem?

Array ('factory' = & gt; array ('album \ model \ album` tab => function ($ sm) {ebb $ sm;},' albumtable gateway '=> function ($ sm) {ebb $ sm ;}, [Advent] '] [' album \ model \ albumTable '] ("test");

This seems to work for me how do you get the function Do you execute?

  $ arr ['factories'] ['newfunction'] = function ($ sm) {ech O $ sm $ s;;; $ arrivals ['factories'] ['NewFunction'] ("test");  

Adding a new man also works as you fly, {$ Function ("factories") $ function) {$ function ("TEST2");}


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -