Test Info
- Hardware: 2016 MacBook Pro w/ 2.9 GHz Intel Core i7, 16 GB 2133 MHz LPDDR3
- MAMP Pro 4.1
- Nginx 1.11.4
- MySQL 5.6.34
- PHP 5.6.28 / 7.1.0 (CGI mode, OPcache enabled)
- ApacheBench 2.3
- Craft CMS 2.6.2958 / 3.0.0-beta.1
<?php | |
namespace foo\bar; | |
use yii\log\Target; | |
/** | |
* Define a LogTarget class that only collects the log messages, but never flushes them out anywhere | |
*/ | |
class LogTarget extends Target | |
{ |
<?php | |
// -- modules/Module.php -- | |
namespace modules; | |
use Craft; | |
use craft\base\Element; | |
use craft\elements\Entry; | |
use craft\events\RegisterPreviewTargetsEvent; |
<?php | |
namespace Craft; | |
class CompatibilityPlugin extends BasePlugin | |
{ | |
function getName() | |
{ | |
return Craft::t('Browser Compatibility'); | |
} |
<?php | |
namespace Craft; | |
class CompatibilityPlugin extends BasePlugin | |
{ | |
function getName() | |
{ | |
return Craft::t('Browser Compatibility'); | |
} |
<?php | |
// ... | |
public function getFieldByHandle($handle) | |
{ | |
return craft()->fields->getFieldByHandle($handle); | |
} |
diff --git Source/craft/app/variables/HttpRequestVariable.php Source/craft/app/variables/HttpRequestVariable.php | |
index fad31b7edab84f5c428e3ce2c3b3ec6e8d92e7ef..430e1adcdf801cccabaf67c89001465c8835fba7 100644 | |
--- Source/craft/app/variables/HttpRequestVariable.php | |
+++ Source/craft/app/variables/HttpRequestVariable.php | |
@@ -201,4 +201,14 @@ class HttpRequestVariable | |
{ | |
return craft()->request->isMobileBrowser($detectTablets); | |
} | |
+ | |
+ /** |
{exp:channel:entries ... } | |
{exp:playa:parents field="matrix_field_name" col="playa_col_name" var_prefix="parent"} | |
{parent:matrix_field search:matrix_col_name="[{entry_id}]" var_prefix="row"} | |
{row:some_col_name} | |
{!-- we can even loop through all of those related entries | |
(which will include the top-level entry) if we want... --} |
<?php | |
public function getEntryJson(EntryModel $entry) | |
{ | |
$entryData = array(); | |
foreach ($entry->getType()->getFieldLayout()->getFields() as $field) | |
{ | |
$field = $field->getField(); | |
$handle = $field->handle; |