Skip to content

Commit

Permalink
Update app-cmsproperties.md (#1828)
Browse files Browse the repository at this point in the history
* Update app-cmsproperties.md

move comment

* Update app-cmsproperties.md

* Update app-cmsproperties.md
  • Loading branch information
dev7ch authored and nadar committed Jun 28, 2018
1 parent 707c6f7 commit 18a94ee
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/guide/app-cmsproperties.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@ Working with a property object:
<?php foreach(Yii::$app->menu->findAll(['parent_nav_id' => 0, 'container' => 'default']) as $item): ?>
<li>
<a href="<?= $item->link; ?>">
<?php /* now depending on the if the property `navImage` is set for this page item we can access this property object. */
if ($item->getProperty('navImage')): ?>
<img src="<?= $item->getProperty('navImage'); ?>" /> // equals to: <img src="<?= $item->getProperty('navImage')->getValue(); ?>" />
<!-- check if the property `navImage` is set for this page item we can access this property object. -->
<?php if ($item->getProperty('navImage')): ?>
<img src="<?= $item->getProperty('navImage'); ?>" alt="some-text"/>
<!-- equals to: <img src="<?= $item->getProperty('navImage')->getValue(); ?>" /> -->
<?php endif; ?>
</a>
</li>
Expand Down

0 comments on commit 18a94ee

Please sign in to comment.