-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creación de lista UIComponent en administrador de Magento P 3/3
Creación de elementos no obligatorios 1.- actualizamos version de modulo a 0.3.0 mas info de como actualizar aqui -> 08703f0 2.- actualízamos , compilamos y asignamos permisos php bin/magento setup:upgrade php bin/magento setup:di:compile chmod -R 777 var/ pub/
- Loading branch information
1 parent
076501b
commit 8a4b633
Showing
4 changed files
with
160 additions
and
1 deletion.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
code/Pfay/Contacts/Controller/Adminhtml/Test/MassDelete.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
namespace Pfay\Contacts\Controller\Adminhtml\Test; | ||
use Magento\Backend\App\Action; | ||
use Pfay\Contacts\Model\Contact; | ||
|
||
class MassDelete extends \Magento\Backend\App\Action | ||
{ | ||
public function execute() | ||
{ | ||
$ids = $this->getRequest()->getParam('selected', []); | ||
if (!is_array($ids) || !count($ids)) { | ||
$resultRedirect = $this->resultRedirectFactory->create(); | ||
return $resultRedirect->setPath('*/*/index', array('_current' => true)); | ||
} | ||
foreach ($ids as $id) { | ||
if ($contact = $this->_objectManager->create(Contact::class)->load($id)) { | ||
$contact->delete(); | ||
} | ||
} | ||
$this->messageManager->addSuccess(__('A total of %1 record(s) have been deleted.', count($ids))); | ||
|
||
$resultRedirect = $this->resultRedirectFactory->create(); | ||
return $resultRedirect->setPath('*/*/index', array('_current' => true)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters