- $sorted = $_REQUEST['sort'] == '1'

.page-header
  %h2
    %li.icon-code
    = Yii::t("app", "Functions")

-if(!$sorted)
  %a(href="#{url('debug/phpFunctions',array('sort'=>1))}")
    =t('Sort')
-else
  %a(href="#{url('debug/phpFunctions',array('sort'=>0))}")
    =t('Not sorted')

%table.table.table-condensed
  %thead
    %tr
      %th=t('Name')
      %th=t('Type')
      %th=t('Defined')
  %tbody
    -foreach(get_defined_functions() as $type => $list)
      -if($sorted)
        -$list = array_sort($list)
      -foreach($list as $name)
        -$func = new ReflectionFunction($name)
        -$filename = $func->getFileName()
        %tr
          %td=$name
          %td=$type
          %td
            -if(fileExists($filename))
              %a(href="#{url('debug/viewastext',array('filename'=>$filename))}")
                =basename($filename)
                =" : ".$func->getStartLine()