• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP k函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中k函数的典型用法代码示例。如果您正苦于以下问题:PHP k函数的具体用法?PHP k怎么用?PHP k使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: spl_autoload_register

require_once 'VIH/configuration.php';
require_once 'konstrukt/konstrukt.inc.php';
require_once 'bucket.inc.php';
require_once 'Ilib/ClassLoader.php';
require_once 'Doctrine.php';
spl_autoload_register(array('Doctrine', 'autoload'));
class VIH_NotFoundComponent extends k_Component
{
    protected $template;
    function __construct(k_TemplateFactory $template)
    {
        $this->template = $template;
    }
    function dispatch()
    {
        $tpl = $this->template->create('404');
        $response = new k_HtmlResponse($tpl->render($this));
        $response->setStatus(404);
        return $response;
    }
}
class VIH_Document extends k_Document
{
}
$factory = new VIH_Factory();
$container = new bucket_Container($factory);
if (realpath($_SERVER['SCRIPT_FILENAME']) == __FILE__) {
    $components = new k_InjectorAdapter($container, new VIH_Document());
    $components->setImplementation('k_DefaultPageNotFoundComponent', 'VIH_NotFoundComponent');
    k()->setComponentCreator($components)->run('VIH_Controller_Login_Root')->out();
}
开发者ID:vih,项目名称:vih.dk,代码行数:31,代码来源:index.php


示例2: empty

      </div>
      <span id='copyright'>
        <?php 
$copyright = empty($config->site->copyright) ? '' : $config->site->copyright . '-';
$contact = json_decode($config->company->contact);
$company = (empty($contact->site) or $contact->site == $this->server->http_host) ? $config->company->name : html::a('http://' . $contact->site, $config->company->name, "target='_blank'");
echo "&copy; {$copyright}" . date('Y') . ' ' . $company . '&nbsp;&nbsp;';
?>
      </span>
      <span id='icpInfo'><?php 
echo $config->site->icpSN;
?>
</span>
      <div id='powerby'>
        <?php 
printf($lang->poweredBy, $config->version, k(), $config->version);
?>
      </div>
    </div>
  </footer>
   
<?php 
if ($config->debug) {
    js::import($jsRoot . 'jquery/form/min.js');
}
if (isset($pageJS)) {
    js::execute($pageJS);
}
/* Load hook files for current page. */
$extPath = dirname(dirname(dirname(__FILE__))) . '/common/ext/view/';
$extHookRule = $extPath . 'footer.front.*.hook.php';
开发者ID:wenyinos,项目名称:chanzhieps,代码行数:31,代码来源:footer.html.php


示例3: setaccess

 function setaccess()
 {
     $rid = $_GET['rid'];
     $db = k("role");
     $role = $db->find($rid);
     $this->assign('role', $role);
     $node = Rbac::getNodeList($rid);
     if (!$node) {
         $this->error("还没有设置权限节点,请设置", 'showaddnode');
     }
     $this->assign('node', $node);
     $this->display();
 }
开发者ID:jyht,项目名称:v5,代码行数:13,代码来源:RbacControl.class.php


示例4: k

include_once "./vendor/autoload.php";
?>
<!doctype html>
<html lang="it">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title></title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">

    </head>
    <body>
	<?php 
if (isset($_GET)) {
    echo '<h2>$_GET</h2>';
    k($_GET);
}
if (isset($_POST)) {
    echo '<h2>$_POST</h2>';
    k($_POST);
}
if (isset($_REQUEST)) {
    echo '<h2>$_REQUEST</h2>';
    k($_REQUEST);
}
?>
    </body>
</html>
开发者ID:nervaccio,项目名称:debug-target-post,代码行数:29,代码来源:index.php


示例5: implode

        if ($tags) {
            if ($user->send_category_as_array != 1) {
                $data['category'] = $tags;
            } else {
                $data['category'] = implode(',', $tags);
            }
        }
    }
    // Handle attachments
    $filename = false;
    foreach ($_FILES as $file) {
        // If a photo was included, set the filename to the downloaded file
        if (preg_match('/image/', $file['type'])) {
            $filename = $file['tmp_name'];
        }
        // Sometimes MMSs are sent with a txt file attached instead of in the body
        if (preg_match('/text\\/plain/', $file['type'])) {
            $content = trim(file_get_contents($file['tmp_name']));
            if ($content) {
                $data['content'] = $content;
            }
        }
    }
    $r = micropub_post_for_user($user, $data, $filename);
    if (k($r, 'location')) {
        $result = 'created post at ' . $r['location'];
    } else {
        $result = 'error creating post';
    }
    $app->response()->body($result);
});
开发者ID:voxpelli,项目名称:Quill,代码行数:31,代码来源:hooks.php


示例6: nl2br

            break;
        default:
            print "<td></td></tr>";
            break;
    }
}
?>
  </table>
</TD></TR>

<TR style="background-color=#f5f5f5"><TD>
  <TABLE BORDER=0 CELLSPACING=2 CELLPADDING=0>
  <tr><td><b>Full text of the complaint</b> &nbsp; (<A HREF="JavaScript:window.print();">click here to print</A>)</td></tr>
  <tr><td>&nbsp;</td></tr>
  <tr><td><?php 
print nl2br(k($c->message));
?>
</td></tr>
  <tr><td>&nbsp;</td></tr>

  <?php 
if ($c->confirmed == "N") {
    ?>
     <tr><td align=center><FORM ACTION="complaint.php?c=<?php 
    print $c->id;
    ?>
&" METHOD=post><input type=submit value="Confirm Receipt"><input name=confirm type=hidden></form></td></tr>
  <?php 
} else {
    ?>
     <tr><td align=center><input type=button value="Back" onClick="JavaScript:location='members.php';"></td></tr>
开发者ID:RobertBohn,项目名称:TellSafe-II,代码行数:31,代码来源:complaint.php


示例7: var_dump

// PHP5 64  allowed with warning "PHP Strict standards:  Only variables
//     should be passed by reference", but does not change the original argument
// HHVM, allowed quietly, but does not change the original argument
var_dump($z);
g($z = $z - 2);
// same as above
var_dump($z);
// g($z++);			// PHP5 32/64, Error: Only variables can be passed by reference
// HHVM,       Error: Cannot pass parameter 1 by reference
// ($z++)++;		// All 3, Error: unexpected '++'
g(--$z);
// PHP5 32, allowed quietly, but does not change the original argument
// PHP5 64  allowed with warning "PHP Strict standards:  Only variables
//     should be passed by reference", but does not change the original argument
// HHVM, allowed quietly, but does not change the original argument
// ----$z;			// All 3, Error: unexpected '--'
var_dump($z);
//*/
///*
function k()
{
    return 10;
}
var_dump(k());
g(k());
// PHP5 32, allowed quietly, but (presumably) does not change the original argument
// PHP5 64  allowed with warning "PHP Strict standards:  Only variables
//     should be passed by reference", but (presumably) does not change the original argument
// k() = 10;   // All 3, Error: Can't use function return value in write context
// HHVM, allowed quietly, but (presumably) does not change the original argument
//*/
开发者ID:mfsousa,项目名称:php-langspec,代码行数:31,代码来源:passing_arguments.php


示例8: upload_file

function upload_file($type = 'img', $dir = '/media/')
{
    global $app;
    if ($type == "img") {
        $file_form = $_FILES['img-file'];
    } else {
        if ($type == "doc") {
            $file_form = $_FILES['doc-file'];
        }
    }
    $maxSize = 25000000;
    $imgExts = array("gif", "jpeg", "jpg", "png");
    $docExts = array("pdf", "doc", "docx", "xls", "xlsx", "csv");
    $allowedExts = array_merge($imgExts, $docExts);
    $allowedTypes = array("image/gif", "image/jpeg", "image/jpg", "image/pjpeg", "image/x-png", "image/png", "application/pdf", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.ms-excel", "application/msword");
    $file_obj = array();
    $file_obj['name'] = str_replace(" ", "_", $file_form['name']);
    $temp = explode(".", $file_obj['name']);
    $file_obj['ext'] = strtolower(end($temp));
    $file_obj['prefix'] = implode("", array_slice($temp, 0, -1));
    $file_obj['error'] = $file_form["error"];
    $file_obj['app_type'] = $file_form["type"];
    $file_obj['size'] = $file_form["size"];
    $file_obj['tmp_name'] = $file_form["tmp_name"];
    // Check for errors
    // File exists
    if (empty($file_form) or empty($file_obj['name'])) {
        $app['_error'] .= "Missing file or filename.<br>";
        return false;
    }
    // Allowed extension
    if (!in_array($file_obj['ext'], $allowedExts)) {
        k($allowedExts);
        $app['_error'] .= "<strong>" . $file_obj['ext'] . "</strong> is not an allowed extension.<br>";
        return false;
    } else {
        // Get file type from extension
        if (in_array($file_obj['ext'], $imgExts)) {
            $file_obj['type'] = "file-image";
        } else {
            $file_obj['type'] = "file-document";
        }
    }
    // Allowed type
    if (!in_array($file_obj['app_type'], $allowedTypes)) {
        $app['_error'] .= "<strong>" . $file_obj['app_type'] . "</strong> is not an allowed file type.<br>";
        return false;
    }
    // Size limit
    if ($file_obj['size'] > $maxSize) {
        $megs = number_format($file_obj['size'] / 1000000, 2);
        $allowedMegs = number_format($maxSize / 1000000, 2);
        $app['_error'] .= "<strong>{$megs} MB</strong> is too large. The maximum size allowed is {$allowedMegs} MB.<br>";
        return false;
    }
    // Other file upload errors
    if ($file_obj['error'] > 0) {
        $app['_error'] .= "Upload file error: " . $file_obj['error'] . "<br>";
        return false;
    }
    if ($app['_error'] === "") {
        $file_obj['path'] = $app['_root_url'] . $dir . $file_obj['name'];
        $file_obj['root_path'] = $app['_web_root'] . $dir . $file_obj['name'];
        if (file_exists($app['_web_root'] . $dir . $file_obj['name'])) {
            $app['_warning'] .= "<strong>Warning: </strong>" . $file_obj['name'] . " already exists. Updating file. <br>";
        }
        if (move_uploaded_file($file_obj['tmp_name'], $file_obj['root_path'])) {
            $app['_success'] .= "Uploaded file to <strong><a href='" . $file_obj['path'] . "' target='_blank'>" . $file_obj['path'] . "</a></strong>.<br>";
        } else {
            $app['_error'] .= "Error moving uploaded file to requested directory. <br>";
        }
        return $file_obj;
    } else {
        return false;
    }
}
开发者ID:jasonnug,项目名称:simple-web-framework,代码行数:76,代码来源:include.php


示例9: fopen

<?php

include "../../class.krumo.php";
$fp = fopen(__FILE__, "r");
$a = array('first' => $fp, 'last' => new bar(), 'null_var' => null, 'float' => pi(), 'bool' => true, ' leading_space' => 6 * 8, 'trailing_space ' => 'grapes', 'middle space' => 'Mt. Rushmore', 'phones' => array(5036541278, 8714077831, 'x253'), 'long_str' => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum...", 'empty_arr' => array(), 'func_str' => 'preg_replace', 'address' => array('street' => '123 Fake Street', 'city' => 'Portland', 'state' => 'Maine'), 'unixtime' => 1231241234, 'microtime' => microtime(1));
if (isset($_GET['short']) || php_sapi_name() === 'cli') {
    kd($a, KRUMO_EXPAND_ALL);
}
print "<h2>krumo capture</h2>\n";
$str = k(array('foo' => 'bar'), KRUMO_RETURN);
print $str;
print "<h2>krumo</h2>\n";
k(array('likes', 'kittens', 'and', 'dogs'));
print "<h2>krumo passing multiple args</h2>\n";
k('likes', 'kittens', 'and', 'dogs');
print "<h2>krumo + die()</h2>\n";
kd($a);
print "If you see this something is broken";
$k = new krumo();
class bar
{
    public $b = 'bb';
    public $a = 'aa';
    public function foo()
    {
        return 'bar';
    }
}
开发者ID:mmucklo,项目名称:krumo,代码行数:28,代码来源:misc.php


示例10: ob_start

<?php

ob_start();
$ss_timer = microtime(true);
require_once '../../conf/global.conf.php';
//create_container();
k()->setComponentCreator(new \Slipstream\Common\Injector\BucketAdapter($i = create_container()))->setLog($debug_log_path)->setDebug($debug_enabled)->run('Slipstream\\JsonRest\\Component\\Root')->out();
//$i->get('Slipstream\Common\Log\Handler')->log($i->get('Slipstream\Common\ConfigurationInterface'),'Execution time');
$i->get('Slipstream\\Common\\Log\\Handler')->log(microtime(true) - $ss_timer, 'Execution time');
ob_end_flush();
开发者ID:jaanush,项目名称:slipstream,代码行数:10,代码来源:index.php


示例11: k

        $response = ['latitude' => null, 'longitude' => null, 'locality' => null, 'region' => null, 'country' => null, 'best_name' => null, 'full_name' => null, 'timezone' => null, 'offset' => null, 'seconds' => null, 'localtime' => null];
        if (k($params, 'input')) {
            $adr = p3k\Geocoder::geocode($params['input']);
        } else {
            $lat = (double) $params['latitude'];
            $lng = (double) $params['longitude'];
            $response['latitude'] = $lat;
            $response['longitude'] = $lng;
            $adr = p3k\Geocoder::adrFromLocation($lat, $lng);
        }
        if ($adr) {
            $response['latitude'] = $adr->latitude;
            $response['longitude'] = $adr->longitude;
            $response['locality'] = $adr->localityName;
            $response['region'] = $adr->regionName;
            $response['country'] = $adr->countryName;
            $response['best_name'] = $adr->bestName;
            $response['full_name'] = $adr->fullName;
        }
        $timezone = p3k\Timezone::timezone_for_location($response['latitude'], $response['longitude'], k($params, 'date'));
        if ($timezone) {
            $response['timezone'] = $timezone->name;
            $response['offset'] = $timezone->offset;
            $response['seconds'] = $timezone->seconds;
            $response['localtime'] = $timezone->localtime;
        }
        json_response($app, $response);
    } else {
        json_response($app, ['error' => 'invalid_request', 'error_description' => 'Request was missing parameters'], 400);
    }
});
开发者ID:aaronpk,项目名称:Atlas,代码行数:31,代码来源:geocode.php


示例12: array

            $username->addValidator('regex', false, array('/^[a-z]+/'));
            $username->addValidator('stringLength', false, array(6, 20));
            $username->setRequired(true);
            $username->addFilter('StringToLower');
            // Create and configure password element:
            $password = $form->createElement('password', 'password');
            $password->setLabel("Password");
            $password->addValidator('StringLength', false, array(6));
            $password->setRequired(true);
            // Add elements to form:
            $form->addElement($username);
            $form->addElement($password);
            // use addElement() as a factory to create 'Login' button:
            $form->addElement('submit', 'login', array('label' => 'Login'));
            // Since we're using this outside ZF, we need to supply a default view:
            $form->setView(new Zend_View());
            $this->form = $form;
        }
        return $this->form;
    }
}
class ZfThanks extends k_Component
{
    function renderHtml()
    {
        return sprintf("<p>%s</p>", htmlspecialchars($this->query('flare')));
    }
}
if (realpath($_SERVER['SCRIPT_FILENAME']) == __FILE__) {
    k()->run('ZfRegistrationForm')->out();
}
开发者ID:RussellDias,项目名称:konstrukt,代码行数:31,代码来源:index.php


示例13:

          <p>The token endpoint did not return an access token. The <code>access_token</code> parameter is the token the client will use to make requests to the Micropub endpoint.</p>
        <?php 
                }
                ?>

        <?php 
                if (!k($this->auth, 'me')) {
                    ?>
          <h4>Missing <code>me</code></h4>
          <p>The token endpoint did not return a "me" parameter. The <code>me</code> parameter lets this client know what user the token is for.</p>
        <?php 
                }
                ?>

        <?php 
                if (!k($this->auth, 'scope')) {
                    ?>
          <h4>Missing <code>scope</code></h4>
          <p>The token endpoint did not return a "scope" parameter. The <code>scope</code> parameter lets this client what permission the token represents.</p>
        <?php 
                }
                ?>

      <?php 
            }
            ?>

    <?php 
        }
        ?>
  <?php 
开发者ID:voxpelli,项目名称:OwnYourGram,代码行数:31,代码来源:auth_callback.php


示例14: dirname

<?php

require_once dirname(__FILE__) . '/../config/global.inc.php';
k()->setComponentCreator(new k_InjectorAdapter(create_container()))->setLog($debug_log_path)->setDebug($debug_enabled)->run('components_Root')->out();
开发者ID:harrysame,项目名称:PHP-MySQL,代码行数:4,代码来源:index.php


示例15: var_dump

{
    echo '$p ' . (isset($p) ? "is set\n" : "is not set\n");
    var_dump($p);
    return $p;
    // return undefined variable
}
$a = array(10, 20, 30);
var_dump($a);
$d =& k($a[0]);
var_dump($d);
var_dump($a);
$d =& k($a[5]);
// non-existant element going in
var_dump($d);
var_dump($a);
$d =& k($a["red"]);
// non-existant element going in
var_dump($d);
var_dump($a);
//*/
///*
// returning literals byRef is okay
function &m1()
{
    return NULL;
}
$d =& m1();
var_dump($d);
function &m2()
{
    return 1234;
开发者ID:jeremyadoux,项目名称:hhvm,代码行数:31,代码来源:using_byrefs_to_undefined_variables.php


示例16: k

?>
"></td></tr>
  <tr><td align=right style="padding-right:5">Country:</td><td><input name=country type=text size=11 maxlength=20 value="<?php 
print k($p->country);
?>
"></td></tr>
  <tr><td align=right style="padding-right:5">Username:</td><td><input name=username type=text size=11 maxlength=16 value="<?php 
print k($p->username);
?>
"></td></tr>
  <tr><td align=right style="padding-right:5">Password:</td><td><input name=password type=text size=11 maxlength=16 value="<?php 
print k($p->password);
?>
"></td></tr>
  <tr><td align=right style="padding-right:5">Security Question:</td><td><input name=question type=text size=28 maxlength=255 value="<?php 
print k($p->question);
?>
"></td></tr>
  <tr><td align=right style="padding-right:5">Security Answer:</td><td><input name=answer type=text size=28 maxlength=255 value="<?php 
print k($p->answer);
?>
"></td></tr>
  <tr><td align=right style="padding-right:5"></td><td style="padding-top:15"><input type=submit value="Create"></td></tr>
  </table>
  </form>
</TD></TR>

</TABLE>

<?php 
include "adminfooter.inc";
开发者ID:RobertBohn,项目名称:TellSafe-II,代码行数:31,代码来源:addcontact.php


示例17: DummyCollection

        return new DummyCollection($sort_by, $ascending);
    }
    protected function getKeys()
    {
        return $this->getSelection()->getKeys();
    }
    protected function getSelection()
    {
        if (!isset($this->collection)) {
            $this->collection = $this->createSelection($this->query('sort'), $this->query('order') == 'asc');
        }
        return $this->collection;
    }
    protected function getPaginator()
    {
        if (!isset($this->paginator)) {
            $this->paginator = new Zend_Paginator(new Zend_Paginator_Adapter_Iterator($this->getSelection()));
            $this->paginator->setCurrentPageNumber($this->query('page'));
            $this->paginator->setItemCountPerPage(10);
        }
        return $this->paginator;
    }
    function renderHtml()
    {
        $t = new k_Template('templates/' . $this->template);
        return $t->render($this, array('collection' => $this->getPaginator(), 'order_asc' => $this->query('order') == 'asc', 'sort' => $this->query('sort'), 'keys' => $this->getKeys(), 'pages' => $this->getPaginator()->getPages()));
    }
}
if (realpath($_SERVER['SCRIPT_FILENAME']) == __FILE__) {
    k()->run('ZfPaginationPage')->out();
}
开发者ID:RussellDias,项目名称:konstrukt,代码行数:31,代码来源:index.php


示例18: k

<?php

include_once 'base.php';
///////////////////////////////////////////////////////////////////////////////
// constants
k("STDIN", Resource);
k("STDOUT", Resource);
k("STDERR", Resource);
///////////////////////////////////////////////////////////////////////////////
// file handle based file operations
f('fopen', Variant, array('filename' => String, 'mode' => String, 'use_include_path' => array(Boolean, 'false'), 'context' => array(Resource, 'null_object')));
f('popen', Variant, array('command' => String, 'mode' => String));
f('fclose', Boolean, array('handle' => Resource));
f('pclose', Variant, array('handle' => Resource));
f('fseek', Variant, array('handle' => Resource, 'offset' => Int64, 'whence' => array(Int64, 'SEEK_SET')));
f('rewind', Boolean, array('handle' => Resource));
f('ftell', Variant, array('handle' => Resource));
f('feof', Boolean, array('handle' => Resource));
f('fstat', Variant, array('handle' => Resource));
f('fread', Variant, array('handle' => Resource, 'length' => Int64));
f('fgetc', Variant, array('handle' => Resource));
f('fgets', Variant, array('handle' => Resource, 'length' => array(Int64, '1024')));
f('fgetss', Variant, array('handle' => Resource, 'length' => array(Int64, '0'), 'allowable_tags' => array(String, 'null_string')));
f('fscanf', Variant, array('handle' => Resource, 'format' => String), ReferenceVariableArguments);
f('fpassthru', Variant, array('handle' => Resource));
f('fwrite', Variant, array('handle' => Resource, 'data' => String, 'length' => array(Int64, '0')));
f('fputs', Variant, array('handle' => Resource, 'data' => String, 'length' => array(Int64, '0')));
f('fprintf', Variant, array('handle' => Resource, 'format' => String), VariableArguments);
f('vfprintf', Variant, array('handle' => Resource, 'format' => String, 'args' => VariantVec));
f('fflush', Boolean, array('handle' => Resource));
f('ftruncate', Boolean, array('handle' => Resource, 'size' => Int64));
开发者ID:huichen,项目名称:hiphop-php,代码行数:31,代码来源:file.idl.php


示例19: get_syndication_targets

        $user->micropub_endpoint = $micropubEndpoint;
        $user->micropub_access_token = $token['auth']['access_token'];
        $user->micropub_scope = $token['auth']['scope'];
        $user->micropub_response = $token['response'];
        $user->save();
        $_SESSION['user_id'] = $user->id();
        // Make a request to the micropub endpoint to discover the syndication targets if any.
        // Errors are silently ignored here. The user will be able to retry from the new post interface and get feedback.
        get_syndication_targets($user);
    }
    unset($_SESSION['auth_state']);
    if ($redirectToDashboardImmediately) {
        if (k($_SESSION, 'redirect_after_login')) {
            $dest = $_SESSION['redirect_after_login'];
            unset($_SESSION['redirect_after_login']);
            $app->redirect($dest, 301);
        } else {
            $app->redirect('/new', 301);
        }
    } else {
        $html = render('auth_callback', array('title' => 'Sign In', 'me' => $me, 'authorizing' => $me, 'meParts' => parse_url($me), 'tokenEndpoint' => $tokenEndpoint, 'auth' => $token['auth'], 'response' => $token['response'], 'curl_error' => array_key_exists('error', $token) ? $token['error'] : false, 'destination' => k($_SESSION, 'redirect_after_login') ?: '/new'));
        $app->response()->body($html);
    }
});
$app->get('/signout', function () use($app) {
    unset($_SESSION['auth']);
    unset($_SESSION['me']);
    unset($_SESSION['auth_state']);
    unset($_SESSION['user_id']);
    $app->redirect('/', 301);
});
开发者ID:jeena,项目名称:Quill,代码行数:31,代码来源:auth.php


示例20: array

        // Default to English
        $phrases = array('Hello' => 'Hello', 'Meatballs' => 'Meatballs');
        if ($context->language()->isoCode() == 'sv') {
            $phrases = array('Hello' => 'Bork, bork, bork!', 'Meatballs' => 'Swedish meatballs');
        }
        return new SimpleTranslator($phrases);
    }
}
class VIH_NotFoundComponent extends k_Component
{
    protected $template;
    function __construct(k_TemplateFactory $template)
    {
        $this->template = $template;
    }
    function dispatch()
    {
        $tpl = $this->template->create('404');
        $response = new k_HtmlResponse($tpl->render($this));
        $response->setStatus(404);
        return $response;
    }
}
$factory = new VIH_Factory();
$container = new bucket_Container($factory);
$mdb2 = $container->get('mdb2_driver_common');
if (realpath($_SERVER['SCRIPT_FILENAME']) == __FILE__) {
    $components = new k_InjectorAdapter($container, new VIH_Document());
    $components->setImplementation('k_DefaultPageNotFoundComponent', 'VIH_NotFoundComponent');
    k()->setComponentCreator($components)->setLanguageLoader(new MyLanguageLoader())->setTranslatorLoader(new SimpleTranslatorLoader())->run('VIH_Controller_Root')->out();
}
开发者ID:vih,项目名称:vih.dk,代码行数:31,代码来源:index.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP k4_bread_crumbs函数代码示例发布时间:2022-05-15
下一篇:
PHP jwTabs函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap