( ! ) Deprecated: Creation of dynamic property CSource::$validImageExtensions is deprecated in /home/saxon/teachers/com/mosstud/www/kod-exempel/oophp-test/Anax-oophp/src/CSource/CSource.php on line 42
Call Stack
#TimeMemoryFunctionLocation
10.0001360192{main}( ).../source.php:0
20.0006364216CSource->__construct( $options = ['secure_dir' => '..', 'base_dir' => '..'] ).../source.php:16

( ! ) Deprecated: Creation of dynamic property CSource::$spaces is deprecated in /home/saxon/teachers/com/mosstud/www/kod-exempel/oophp-test/Anax-oophp/src/CSource/CSource.php on line 43
Call Stack
#TimeMemoryFunctionLocation
10.0001360192{main}( ).../source.php:0
20.0006364216CSource->__construct( $options = ['secure_dir' => '..', 'base_dir' => '..'] ).../source.php:16

( ! ) Deprecated: Creation of dynamic property CSource::$ignore is deprecated in /home/saxon/teachers/com/mosstud/www/kod-exempel/oophp-test/Anax-oophp/src/CSource/CSource.php on line 44
Call Stack
#TimeMemoryFunctionLocation
10.0001360192{main}( ).../source.php:0
20.0006364216CSource->__construct( $options = ['secure_dir' => '..', 'base_dir' => '..'] ).../source.php:16

( ! ) Deprecated: Creation of dynamic property CSource::$secureDir is deprecated in /home/saxon/teachers/com/mosstud/www/kod-exempel/oophp-test/Anax-oophp/src/CSource/CSource.php on line 45
Call Stack
#TimeMemoryFunctionLocation
10.0001360192{main}( ).../source.php:0
20.0006364216CSource->__construct( $options = ['secure_dir' => '..', 'base_dir' => '..'] ).../source.php:16

( ! ) Deprecated: Creation of dynamic property CSource::$baseDir is deprecated in /home/saxon/teachers/com/mosstud/www/kod-exempel/oophp-test/Anax-oophp/src/CSource/CSource.php on line 46
Call Stack
#TimeMemoryFunctionLocation
10.0001360192{main}( ).../source.php:0
20.0006364216CSource->__construct( $options = ['secure_dir' => '..', 'base_dir' => '..'] ).../source.php:16

( ! ) Deprecated: Creation of dynamic property CSource::$queryPath is deprecated in /home/saxon/teachers/com/mosstud/www/kod-exempel/oophp-test/Anax-oophp/src/CSource/CSource.php on line 47
Call Stack
#TimeMemoryFunctionLocation
10.0001360192{main}( ).../source.php:0
20.0006364216CSource->__construct( $options = ['secure_dir' => '..', 'base_dir' => '..'] ).../source.php:16

( ! ) Deprecated: Creation of dynamic property CSource::$suggestedPath is deprecated in /home/saxon/teachers/com/mosstud/www/kod-exempel/oophp-test/Anax-oophp/src/CSource/CSource.php on line 48
Call Stack
#TimeMemoryFunctionLocation
10.0001360192{main}( ).../source.php:0
20.0006364216CSource->__construct( $options = ['secure_dir' => '..', 'base_dir' => '..'] ).../source.php:16

( ! ) Deprecated: Creation of dynamic property CSource::$realPath is deprecated in /home/saxon/teachers/com/mosstud/www/kod-exempel/oophp-test/Anax-oophp/src/CSource/CSource.php on line 49
Call Stack
#TimeMemoryFunctionLocation
10.0001360192{main}( ).../source.php:0
20.0006364216CSource->__construct( $options = ['secure_dir' => '..', 'base_dir' => '..'] ).../source.php:16

( ! ) Deprecated: Creation of dynamic property CSource::$pathinfo is deprecated in /home/saxon/teachers/com/mosstud/www/kod-exempel/oophp-test/Anax-oophp/src/CSource/CSource.php on line 50
Call Stack
#TimeMemoryFunctionLocation
10.0001360192{main}( ).../source.php:0
20.0006364216CSource->__construct( $options = ['secure_dir' => '..', 'base_dir' => '..'] ).../source.php:16

( ! ) Deprecated: Creation of dynamic property CSource::$file is deprecated in /home/saxon/teachers/com/mosstud/www/kod-exempel/oophp-test/Anax-oophp/src/CSource/CSource.php on line 66
Call Stack
#TimeMemoryFunctionLocation
10.0001360192{main}( ).../source.php:0
20.0006364216CSource->__construct( $options = ['secure_dir' => '..', 'base_dir' => '..'] ).../source.php:16

( ! ) Deprecated: Creation of dynamic property CSource::$extension is deprecated in /home/saxon/teachers/com/mosstud/www/kod-exempel/oophp-test/Anax-oophp/src/CSource/CSource.php on line 67
Call Stack
#TimeMemoryFunctionLocation
10.0001360192{main}( ).../source.php:0
20.0006364216CSource->__construct( $options = ['secure_dir' => '..', 'base_dir' => '..'] ).../source.php:16

( ! ) Deprecated: Creation of dynamic property CSource::$dir is deprecated in /home/saxon/teachers/com/mosstud/www/kod-exempel/oophp-test/Anax-oophp/src/CSource/CSource.php on line 68
Call Stack
#TimeMemoryFunctionLocation
10.0001360192{main}( ).../source.php:0
20.0006364216CSource->__construct( $options = ['secure_dir' => '..', 'base_dir' => '..'] ).../source.php:16

( ! ) Deprecated: Creation of dynamic property CSource::$path is deprecated in /home/saxon/teachers/com/mosstud/www/kod-exempel/oophp-test/Anax-oophp/src/CSource/CSource.php on line 69
Call Stack
#TimeMemoryFunctionLocation
10.0001360192{main}( ).../source.php:0
20.0006364216CSource->__construct( $options = ['secure_dir' => '..', 'base_dir' => '..'] ).../source.php:16

( ! ) Deprecated: Creation of dynamic property CSource::$breadcrumb is deprecated in /home/saxon/teachers/com/mosstud/www/kod-exempel/oophp-test/Anax-oophp/src/CSource/CSource.php on line 81
Call Stack
#TimeMemoryFunctionLocation
10.0001360192{main}( ).../source.php:0
20.0006364216CSource->__construct( $options = ['secure_dir' => '..', 'base_dir' => '..'] ).../source.php:16

( ! ) Deprecated: Creation of dynamic property CSource::$message is deprecated in /home/saxon/teachers/com/mosstud/www/kod-exempel/oophp-test/Anax-oophp/src/CSource/CSource.php on line 85
Call Stack
#TimeMemoryFunctionLocation
10.0001360192{main}( ).../source.php:0
20.0006364216CSource->__construct( $options = ['secure_dir' => '..', 'base_dir' => '..'] ).../source.php:16

( ! ) Deprecated: Creation of dynamic property CSource::$content is deprecated in /home/saxon/teachers/com/mosstud/www/kod-exempel/oophp-test/Anax-oophp/src/CSource/CSource.php on line 235
Call Stack
#TimeMemoryFunctionLocation
10.0001360192{main}( ).../source.php:0
20.0015367296CSource->View( ).../source.php:22
30.0021368448CSource->GetFileContent( ).../CSource.php:113

( ! ) Deprecated: Creation of dynamic property CSource::$encoding is deprecated in /home/saxon/teachers/com/mosstud/www/kod-exempel/oophp-test/Anax-oophp/src/CSource/CSource.php on line 166
Call Stack
#TimeMemoryFunctionLocation
10.0001360192{main}( ).../source.php:0
20.0015367296CSource->View( ).../source.php:22
30.0021368448CSource->GetFileContent( ).../CSource.php:113
40.0023370520CSource->DetectFileDetails( ).../CSource.php:236

( ! ) Deprecated: Creation of dynamic property CSource::$lineendings is deprecated in /home/saxon/teachers/com/mosstud/www/kod-exempel/oophp-test/Anax-oophp/src/CSource/CSource.php on line 181
Call Stack
#TimeMemoryFunctionLocation
10.0001360192{main}( ).../source.php:0
20.0015367296CSource->View( ).../source.php:22
30.0021368448CSource->GetFileContent( ).../CSource.php:113
40.0023370520CSource->DetectFileDetails( ).../CSource.php:236
Visa källkod | Anax en webbtemplate

Visa källkod

dice.php

1 lines UTF-8 Unix (LF)
<?php 
/**
 * This is a Anax pagecontroller.
 *
 */
// Include the essential config-file which also creates the $anax variable with its defaults.
include(__DIR__.'/config.php'); 



// Demonstration of module CDice
$dice = new CDice();

$roll = isset($_GET['roll']) && is_numeric($_GET['roll']) ? $_GET['roll'] : 0;

if($roll > 100) {
  throw new Exception("To many rolls on the dice. Not allowed.");
}

$html = null;
if($roll) {
  $dice->Roll($roll);

  $html = "<p>Du gjorde {$roll} kast och fick följande resultat.</p>\n<ul>";
  foreach($dice->GetResults() as $val) {
    $html .= "\n<li>{$val}</li>";
  }
  $html .= "\n</ul>\n";

  $html .= "<p>Totalt fick du " . $dice->GetTotal() . " poäng på dina kast.</p>";
}



// Do it and store it all in variables in the Anax container.
$anax['title'] = "Kasta tärning";

$anax['main'] = <<<EOD
<h1>Kasta tärning</h1>
<p>Detta är en exempelsida som visar hur Anax fungerar tillsammans med återanvändbara moduler.</p>
<p>Hur många kast vill du göra, <a href='?roll=1'>1 kast</a>, <a href='?roll=3'>3 kast</a> eller <a href='?roll=6'>6 kast</a>? </p>
{$html}
EOD;



// Finally, leave it all to the rendering phase of Anax.
include(ANAX_THEME_PATH);