View singleton_instances_magento2.php
<?php | |
class SomeClass | |
{ | |
/** | |
* @var \Magento\Framework\App\Config\ScopeConfigInterface | |
*/ | |
private $configInterface; | |
/** | |
* @var \Magento\Framework\App\Config |
View load_model_magento2.php
<?php | |
class SomeClass | |
{ | |
/** | |
* @var \Magento\Catalog\Model\ResourceModel\Product | |
*/ | |
private $productResource; | |
/** | |
* @var \Magento\Catalog\Model\ProductFactory | |
*/ |
View SomeClass.php
class SomeClass | |
{ | |
public function __construct( | |
\Magento\Framework\Filter\Template $templateFilter | |
) | |
{ | |
$this->templateFilter = $templateFilter; | |
} | |
public function getDirectiveContent() |
View m2_reindexall_programmatically.php
<?php | |
/** | |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
* @author Hervé Guétin <herve.guetin@gmail.com> <@herveguetin> | |
*/ | |
class Reindex | |
{ | |
/** | |
* @var \Magento\Indexer\Console\Command\IndexerReindexCommand |
View lumen_ide_helper.php
<?php | |
/** | |
* A helper file for Laravel 5, to provide autocomplete information to your IDE | |
* Generated for Laravel Lumen (5.1.1) (Laravel Components 5.1.*) on 2015-08-18. | |
* | |
* @author Barry vd. Heuvel <barryvdh@gmail.com> | |
* @see https://github.com/barryvdh/laravel-ide-helper | |
*/ | |
namespace { |
View new
new again |
View add_column_after.php
<?php | |
namespace My\Module\Setup; | |
use Magento\Framework\Setup\ModuleContextInterface; | |
use Magento\Framework\Setup\SchemaSetupInterface; | |
use Magento\Framework\Setup\UpgradeSchemaInterface; | |
/** | |
* @codeCoverageIgnore | |
*/ |
View wishlist_force_redirection_after_login_magento.php
<?php | |
// 1. Observe the following event: controller_action_predispatch_wishlist_index_add which calls, for example, the `forceReferer()` method | |
// 2. In your observer class, implement the `forceReferer()` method | |
/** | |
* When adding a product to wishlist, | |
* force redirection to wishlist page after customer login | |
* | |
*/ | |
public function forceReferer(Varien_Event_Observer $observer) |
View standalone_layout.php
<?php | |
/** | |
* Retrieve content of a standalone layout | |
* | |
* @return string | |
* @throws Mage_Core_Exception | |
*/ | |
public function getStandaloneLayoutHtml() | |
{ | |
$layout = Mage::getModel('core/layout'); // Instanciate a brand new layout (not using the singleton from Mage::app()->getLayout()) |
View setup.php
<?php | |
$tree = array( | |
'Category A' => array( | |
'Category A-B' => array( | |
'Category A-B-A', | |
'Category A-B-B' | |
), | |
'Category A-C' => array( | |
'Category A-C-A', | |
'Category A-C-B' |
NewerOlder