public function listviewscriptsAction()
    {
        $config = $this->config;

        $table = new Table(
            array('columnWidths' => array(40, 40, 40),
                                 'decorator' => 'ascii')
        );

        $table->appendRow(array('Module', 'Name', 'Description'));

        $offset=strlen(getcwd())+1;
        $links="";
        $github='https://github.com/cross-solution/YAWIK/blob/master/';

        foreach ($config['view_manager']['template_map'] as $key => $absolute_filename) {
            // strip the application_root plus an additional slash
            $filename=substr(realpath($absolute_filename), $offset);
            if (preg_match('~module/([^/]+)~', $filename, $match)) {
                $module=$match[1];
            } else {
                $module="not found ($key)";
            }

            $viewModel = new ViewModel();
            $viewModel->setTemplate($key);

            $row = new Row();
            $row->appendColumn(new Column($module));
            if ($filename) {
                $row->appendColumn(new Column('`' . $key . '`_'));
                $links.='.. _'. $key .': '. $github.$filename .PHP_EOL;
            } else {
                $row->appendColumn(new Column("WRONG CONFIGURATION"));
            }
            $comment="";
            if (file_exists($absolute_filename)) {
                $src=file_get_contents($absolute_filename);
                $comment="file exists";
                if (preg_match("/{{rtd:\s*(.*)}}/", $src, $match)) {
                    $comment=$match['1'];
                }
            }
            $row->appendColumn(new Column($comment));
            $table->appendRow($row);
        }

        echo $table.PHP_EOL;
        echo $links;

        return PHP_EOL;
    }
public function listviewscriptsAction()
    {
        $config = $this->config;

        $table = new Table(
            array('columnWidths' => array(40, 40, 40),
                                 'decorator' => 'ascii')
        );

        $table->appendRow(array('Module', 'Name', 'Description'));

        $offset=strlen(getcwd())+1;
        $links="";
        $github='https://github.com/cross-solution/YAWIK/blob/master/';

        foreach ($config['view_manager']['template_map'] as $key => $absolute_filename) {
            // strip the application_root plus an additional slash
            $filename=substr(realpath($absolute_filename), $offset);
            if (preg_match('~module/([^/]+)~', $filename, $match)) {
                $module=$match[1];
            } else {
                $module="not found ($key)";
            }

            $viewModel = new ViewModel();
            $viewModel->setTemplate($key);

            $row = new Row();
            $row->appendColumn(new Column($module));
            if ($filename) {
                $row->appendColumn(new Column('`' . $key . '`_'));
                $links.='.. _'. $key .': '. $github.$filename .PHP_EOL;
            } else {
                $row->appendColumn(new Column("WRONG CONFIGURATION"));
            }
            $comment="";
            if (file_exists($absolute_filename)) {
                $src=file_get_contents($absolute_filename);
                $comment="file exists";
                if (preg_match("/{{rtd:\s*(.*)}}/", $src, $match)) {
                    $comment=$match['1'];
                }
            }
            $row->appendColumn(new Column($comment));
            $table->appendRow($row);
        }

        echo $table.PHP_EOL;
        echo $links;

        return PHP_EOL;
    }
public function listviewscriptsAction ( ) { $ config = $ this -> config ; $ table = new Table ( array ( 'columnWidths' => array ( 40 , 40 , 40 ) , 'decorator' => 'ascii' ) ) ; $ table -> appendRow ( array ( 'Module' , 'Name' , 'Description' ) ) ; $ offset = strlen ( getcwd ( ) ) + 1 ; $ links = "" ; $ github = 'https://github.com/cross-solution/YAWIK/blob/master/' ; foreach ( $ config [ 'view_manager' ] [ 'template_map' ] as $ key => $ absolute_filename ) { // strip the application_root plus an additional slash $ filename = substr ( realpath ( $ absolute_filename ) , $ offset ) ; if ( preg_match ( '~module/([^/]+)~' , $ filename , $ match ) ) { $ module = $ match [ 1 ] ; } else { $ module = "not found ($key)" ; } $ viewModel = new ViewModel ( ) ; $ viewModel -> setTemplate ( $ key ) ; $ row = new Row ( ) ; $ row -> appendColumn ( new Column ( $ module ) ) ; if ( $ filename ) { $ row -> appendColumn ( new Column ( '`' . $ key . '`_' ) ) ; $ links .= '.. _' . $ key . ': ' . $ github . $ filename . PHP_EOL ; } else { $ row -> appendColumn ( new Column ( "WRONG CONFIGURATION" ) ) ; } $ comment = "" ; if ( file_exists ( $ absolute_filename ) ) { $ src = file_get_contents ( $ absolute_filename ) ; $ comment = "file exists" ; if ( preg_match ( "/{{rtd:\s*(.*)}}/" , $ src , $ match ) ) { $ comment = $ match [ '1' ] ; } } $ row -> appendColumn ( new Column ( $ comment ) ) ; $ table -> appendRow ( $ row ) ; } echo $ table . PHP_EOL ; echo $ links ; return PHP_EOL ; }
list available view scripts
list available view scripts