Error Undefined index
Posted: 05 January 2017, 15:35
Hi all, I am following the tutorial to create elements on the board game I am developing. I am working on tpl, css and view file at the moment. I met some error which I do not understand what causes it.
I am loading my game board after I added a tile element in my css:
.tile {
width: 60px;
height: 60px;
position: absolute;
background-color: red;
}
I followed by editing the tpl file:
<div id="board">
<!-- BEGIN tile -->
<div id="tile_{X}_{Y}" class="tile" style="left: {LEFT}px; top: {TOP}px;"></div>
<!-- END tile -->
</div>
And I attempt to add a tile element on the board in the view file:
function build_page( $viewArgs )
{
// Get players & players number
$players = $this->game->loadPlayersBasicInfos();
$players_nbr = count( $players );
/*********** Place your code below: ************/
//$this->page->begin_block( "greatwesterntrailgwt_greatwesterntrailgwt", "tile" );
$this->page->insert_block( "tile", array('X' => 381,'Y' => 168,'LEFT' => 381,'TOP' => 168) );
.
.
.
.
}
Upon loading my game board, I got the following error on the top of the page:
Notice: Undefined index: tile in /var/tournoi/release/tournoi-151226-1240-gs/www/include/APP_Template.inc.php on line 140
I notice this has to do with my tile element, but I do not understand the cause of error.
Please help a noob. Thank you.
I am loading my game board after I added a tile element in my css:
.tile {
width: 60px;
height: 60px;
position: absolute;
background-color: red;
}
I followed by editing the tpl file:
<div id="board">
<!-- BEGIN tile -->
<div id="tile_{X}_{Y}" class="tile" style="left: {LEFT}px; top: {TOP}px;"></div>
<!-- END tile -->
</div>
And I attempt to add a tile element on the board in the view file:
function build_page( $viewArgs )
{
// Get players & players number
$players = $this->game->loadPlayersBasicInfos();
$players_nbr = count( $players );
/*********** Place your code below: ************/
//$this->page->begin_block( "greatwesterntrailgwt_greatwesterntrailgwt", "tile" );
$this->page->insert_block( "tile", array('X' => 381,'Y' => 168,'LEFT' => 381,'TOP' => 168) );
.
.
.
.
}
Upon loading my game board, I got the following error on the top of the page:
Notice: Undefined index: tile in /var/tournoi/release/tournoi-151226-1240-gs/www/include/APP_Template.inc.php on line 140
I notice this has to do with my tile element, but I do not understand the cause of error.
Please help a noob. Thank you.