Newscoop\Service\Template::storeItem PHP Method

storeItem() public method

Store item
public storeItem ( string $key, string $data ) : void
$key string
$data string
return void
    public function storeItem($key, $data)
    {
        $this->storage->storeItem($key, $data);
    }

Usage Example

Example #1
0
 public function editTemplateAction()
 {
     $key = $this->getKey();
     $form = new Admin_Form_Template();
     $form->setMethod('post');
     $metadata = $this->service->fetchMetadata($key);
     $form->setDefaults(array('content' => $this->service->fetchItem($key), 'cache_lifetime' => $metadata->type == 'tpl' ? $metadata->ttl : 0));
     $request = $this->getRequest();
     if ($request->isPost() && $form->isValid($request->getPost())) {
         $values = $form->getValues();
         $this->service->storeItem($key, $values['content']);
         if ($metadata->type == 'tpl') {
             $this->service->storeMetadata($key, $values);
             $this->_helper->entity->flushManager();
         }
         $this->_helper->flashMessenger(getGS("Template '\$1' \$2.", basename($key), getGS('updated')));
         $this->_redirect(urldecode($this->_getParam('next')), array('prependBase' => false));
     }
     $this->view->form = $form;
 }
All Usage Examples Of Newscoop\Service\Template::storeItem