How to view the model data values in Layout file

Hi,

In Yii 2.0 how to use find all condition in the layout file

I want to display the all project name in the layout file…

How to use find all condition in the layout file

My code in the Layout file main2.php

<?php $model = Project_manage::find()->all(); ?>

We use this code the following error will occur

Error (#1)

An internal server error occurred.(These Error are came)

Kindly help me to fix this,

Thanks

itis working inmy case


 <?php $modelcity = City::find()->all();

              foreach ($modelcity as $list) {

                print_r($list->cityName);

                }  ?>

exactly same u want u can try this.

i m getting all the city data on layout file.

if ny custom code u have done than kindly share ur code.