当前位置: 首页>>代码示例>>PHP>>正文


PHP Output::display方法代码示例

本文整理汇总了PHP中Output::display方法的典型用法代码示例。如果您正苦于以下问题:PHP Output::display方法的具体用法?PHP Output::display怎么用?PHP Output::display使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Output的用法示例。


在下文中一共展示了Output::display方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Output

<?php

require_once 'output.php';
require_once 'square.php';
require_once 'cube.php';
require_once 'fourth.php';
$input = 10;
$output = new Output(new Square());
echo $output->display($input);
$output->setStrategy(new Cube());
echo $output->display($input);
$output->setStrategy(new Fourth());
echo $output->display($input);
开发者ID:JarJarMP,项目名称:MyToolbox,代码行数:13,代码来源:index.php

示例2: Output

<?php

include_once 'output.php';
include_once 'square.php';
include_once 'cube.php';
include_once 'rectangle.php';
$inputA = 10;
$inputB = 20;
$output = new Output(new Square());
echo $output->display($inputA) . '<br>';
$output->setStrategy(new Cube());
echo $output->display($inputA) . '<br>';
$output->setStrategy(new Rectangle());
echo $output->display($inputA, $inputB) . '<br>';
开发者ID:sbogdanov108,项目名称:patterns,代码行数:14,代码来源:index.php

示例3: call_user_func

    }
    // instantiate the controller (and run its constructor)
    $class = Core::controller($class);
    // Call the remapping function if it's present in the controller
    if (method_exists($class, '_remap')) {
        call_user_func(array($class, '_remap'));
    } else {
        if (!method_exists($class, $method)) {
            Core::error404($uri);
        }
        // Call the requested method. Any URI segments present
        // (besides the controller/action) will be passed to the method for convenience
        call_user_func_array(array($class, $method), array_slice(Uri::routedsegments(), 2));
    }
    // send final output
    Output::display();
}
// -------------------------------------------------------------  Support Functions
function urlpath($url)
{
    return str_replace(URL, ROOT, $url);
}
function rmroot($path)
{
    return str_replace(ROOT, '', $path);
}
function error($msg)
{
    unlink(TMP . 'system.chk');
    die("<h1 style='color:#900'>{$msg}</h1>");
}
开发者ID:hectormenendez,项目名称:h23,代码行数:31,代码来源:index.php

示例4: setSize

    {
        $this->color = $color;
    }
    function setSize($size)
    {
        $this->size = $size;
    }
}
class Output
{
    var $lookandfeel;
    var $output;
    // Constructor takes LookAndFeel as its argument
    function Output($lookandfeel)
    {
        $this->lookandfeel = $lookandfeel;
    }
    function buildOutput()
    {
        $this->output = 'Color is ' . $this->lookandfeel->getColor() . ' and size is ' . $this->lookandfeel->getSize();
    }
    function display()
    {
        $this->buildOutput();
        return $this->output;
    }
}
$lookandfeel = new LookAndFeel();
$output = new Output($lookandfeel);
echo $output->display();
开发者ID:beingvarun,项目名称:php,代码行数:30,代码来源:reference.php


注:本文中的Output::display方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。