layoutにデータを渡しているのですが最後の行のprint($para['database']);で表示ができず困っています。
layoutにデータが渡せれていることは確認済みです。
プルダウンのボタンに表示させたいのですがそれが原因なのでしょうか?
まったく表示できず何が原因かわからず困っています。
<?php class EntityController extends AppController { var $name = 'Entity'; var $components = array('RequestHandler','Auth','Common'); var $user; function index() { $this->Entity->setDataSource('hive'); //パラメータ解析 if ( isset($this->params['url']['database_id']) ){ $p_database_id=$this->params['url']['database_id']; }else{ $p_database_id="default"; } if ( isset($this->params['url']['table_id']) ){ $p_table_id=$this->params['url']['table_id']; }else{ $p_table_id=""; } if ( isset($this->params['form']['filter']) ){ $p_filter=$this->params['form']['filter']; }else{ if ( isset($this->params['url']['filter']) ){ $p_filter=$this->params['url']['filter']; }else{ $p_filter=""; } } if ( !file_exists(DIR_ENTITY."/data/${p_database_id}/table/${p_table_id}.dat") ){ $p_table_id=""; } //CLEARボタンクリック if ( isset($this->params['form']['clear_x']) or isset($this->params['form']['clear_y'])){ $p_database_id="default"; $p_table_id=""; $p_filter=""; } //GOボタンクリック if ( isset($this->params['form']['x']) or isset($this->params['form']['y'])){ $p_table_id=""; } ////////////////////////////////////////////////////////////////// //データベース一覧SQL ////////////////////////////////////////////////////////////////// $sql ="select * from DBS;"; $dbs= $this->Entity->query($sql); //debug($result); $this->set('dbs', $dbs); }
layoutのentity.ctp
<html> <head> <title>hive configuration</title> <link href="/WebHive/css/main.css" rel="stylesheet"> </head> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" > <a name='page_top'></a> <?php echo $this->element('banner'); ?> <table width="100%" height="100%" cellspacing="0" cellpadding="0"> <tr height="5" bgcolor="#dfe9f6" class="noprint"> <td colspan="2"> <table width="100%"> <tr> <td align="left"> <?php echo APP_TITLE ?><?php echo $app_title_msg; ?> </td> <td align="right"> <br> <?php echo $user['User']['username']."さん"; ?> |<a href='/WebHive/users/logout'>LOGOUT</a> |<a href='/WebHive/'>WebHive</a> |<a href="/WebHive/help" onclick="window.open('/WebHive/help','_blank','width=900,height=500,scrollbars=yes'); return false;">変更履歴</a>| </td> </tr> </table> </td> </tr> <tr class="noprint"> <td bgcolor="#efefef" colspan="1" height="8" style="background-image: url(/WebHive/img/shadow_gray.gif); background-repeat: repeat-x; border-right: #aaaaaa 1px solid;"> <img src="/WebHive/img/transparent_line.gif" width="200" height="2" border="0"><br> </td> <td bgcolor="#ffffff" colspan="1" height="8" style="background-image: url(/WebHive/img/shadow.gif); background-repeat: repeat-x;"> </td> </tr> <tr> <td valign="top" style="padding: 5px; border-right: #aaaaaa 1px solid;"> <script type="text/javascript"> <!-- function applyGraphPreviewFilterChange(objForm) { strURL = '?action=preview'; strURL = strURL + '&database_id=' + objForm.database_id.value; strURL = strURL + '&table_id=' + objForm.table_id.value; strURL = strURL + '&filter=' + objForm.filter.value; document.location = strURL; } --> </script> <table width='100%' style='background-color: #f5f5f5; border: 1px solid #bbbbbb;' align='center' cellpadding='3'> <tr bgcolor="E5E5E5" class="noprint"> <form name="form_graph_view" method="post"> <td class="noprint"> <table width="100%" cellpadding="0" cellspacing="0"> <tr class="noprint"> <td nowrap style='white-space: nowrap;' width="40"> <strong>Database:</strong> </td> <td width="1"> <select name="database_id" onChange="applyGraphPreviewFilterChange(document.form_graph_view)"> <?php foreach($dbs as $name){ $p_database=$name['DBS']['NAME']; $para['database']=$p_database; debug($para['database']); } print($para['database']); ?>
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/10/27 02:27
2016/10/27 02:31
2016/10/27 02:41
2016/10/27 03:00