如何从 phalcon 中的 table 填充 select 选项?

How to populate the select options from a table in phalcon?

我有一个列表,其中包含带有 id namestatus 的标签 table,在我的模型 TagsStandard 中,我有这个:

const STATUS_APPROVED = 1;
const STATUS_DISABLED= 0;

public $id;
public $name;
public $status; 

public static function getAllTag()
{
    $tags = TagsStandard::find(array(
        "status = 'STATUS_APPROVED'",
        "order" => "id"
    ));
}

所以我得到了所有的标签。现在在 indexAction 的 Controller 我有:

$tags = TagsStandard::getAllTag();
if ($tags) {
    $this->view->tags = $tags;
    $this->view->name = array("name" => $tags->name->toArray());
}

在索引中我有:

<select id='user-skills-input' class="select-chosen" type="text" data-role="tagsinput" value="" multiple>
   <?php if(count($tags) > 0): ?>
   <?php foreach($tags->items as $idx => $tag): 
       echo "<option value='" . $tag->id . "'> " . $tag->name . "</option>" ?>
   <?php endforeach; ?>
   <?php endif; ?>
</select>

这些值没有显示在选项中,所以有人可以帮我解决这个问题吗?

<?php
echo \Phalcon\Tag::select(array(
    "user-skills-input",
    TagsStandard::find(array(
        "status = 'STATUS_APPROVED'",
        "order" => "id"
    )),
    "using" => array("id", "name")
    );

Phalcon Tags#select