Php tips & tricks

Comment php code with one keypress

Debugging takes 90% of php developement time. You often need to comment out a piece code. In case of single line it is pretty simple. But if you need to comment large block it could take time. Do you want to comment php code with one keypress ?
There is pretty simple method to achieve it. Just wrap your code with /**/

/**/
$request->setModuleName('faqpage')
    ->setControllerName('index')
    ->setActionName('index');
$request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS,
     $identifier);
/**/

If you want to comment it just add a backslash.

/**\/
$request->setModuleName('faqpage')
    ->setControllerName('index')
    ->setActionName('index');
$request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS,
     $identifier);
/**/

Leave a Reply

Your email address will not be published. Required fields are marked *