cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

[2.0.0]Registry functionality missing from 1.3.4

Open eclipse88 opened this issue 11 years ago • 5 comments

Not supporting this very useful functionality from 1.3.4

$di->set('registry', function() {
    return new Phalcon\Registry();
}, true);

//not working in 2.0.0
$this->registry->user = [];
$this->registry->user['id'] = 1;

//must doing this
$this->registry->user = ['id' => 1];

and if you collecting data from entire application you need to do this:

$data = [];
if($this->registry->offsetExists('data'){//by the way isset($this->registry->data) always return false in 2.0.0
     $data = $this->registry->data;
}
$data['asd'] = 'asd';
$this->registry->data = $data;

//instead
$this->registry->data['asd'];

eclipse88 avatar Apr 21 '15 08:04 eclipse88

@eclipse88 I corrected only part of the problem. The rest of the fix is not possible, because Zephir not support links!

It works

if ( $this->registry->data) {
   ...
}

if (isset($this->registry->data)) {
   ...
}

KorsaR-ZN avatar Apr 21 '15 13:04 KorsaR-ZN

@KorsaR-ZN Marshmallow ?

andresgutierrez avatar Apr 23 '15 03:04 andresgutierrez

@KorsaR-ZN Marshmallow LOL :smile_cat:

@andresgutierrez Marshmallow = Transliterate Zephir to Russian and translate to English mallow-1

sergeyklay avatar Apr 23 '15 09:04 sergeyklay

@andresgutierrez, @sergeyklay :) Now this is a new name for Zephir :D

KorsaR-ZN avatar Apr 23 '15 09:04 KorsaR-ZN

@andresgutierrez fixed in 2.0.1

Green-Cat avatar May 26 '15 10:05 Green-Cat