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


PHP runner::toAscii方法代码示例

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


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

示例1: array_shift

 }
 $parents = \Routerunner\Bootstrap::parent($reference);
 if (isset($parents[0]["model_class"]) && $parents[0]["model_class"] == "lang") {
     $lang = array_shift($parents);
 }
 $path_route = '';
 while ($parent = array_shift($parents)) {
     $_model_context = array("direct" => $parent["reference"], "session" => \runner::stack("session_id"));
     $router = false;
     $route = '/model/' . $parent["model_class"];
     \runner::redirect_route($route, \runner::config("scaffold"), true, $_model_context, $router, $parent_model);
     if (is_array($parent_model) && count($parent_model) == 1) {
         $parent_model = array_shift($parent_model);
     }
     if (isset($parent_model) && is_object($parent_model) && get_parent_class($parent_model) == "Routerunner\\BaseModel" && isset($parent_model->label)) {
         $path_route .= \runner::toAscii($parent_model->label) . DIRECTORY_SEPARATOR;
     }
     $debug = 1;
 }
 if (isset($value["src"])) {
     // crop image
     $src = $_SESSION["runner_config"]['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $_SESSION["runner_config"]["SITEROOT"] . $value["src"];
     $filename = substr($value["src"], strrpos($value["src"], DIRECTORY_SEPARATOR) + 1);
     $mimetype = false;
     $layer = ImageWorkshop::initFromPath($src, false, $mimetype);
     if (isset($value["rotate"])) {
         $layer->rotate($value["rotate"]);
     } elseif (isset($value["angle"])) {
         $layer->rotate($value["angle"]);
     }
     if ($crops) {
开发者ID:RetroscopeCreative,项目名称:RouterunnerCMS,代码行数:31,代码来源:crop_cropper.php

示例2: rr_property_tag

 function rr_property_tag($model)
 {
     $delimiter = ";";
     $tag_property = strtolower($model->tag);
     $tags = explode($delimiter, $tag_property);
     if ($tags && count($tags) == 1 && trim($tags[0]) === "") {
         $tags = array();
     }
     $return = '<span class="a_tags">';
     $tag_urls = "";
     foreach ($tags as $tag) {
         $tag_urls .= "'" . trim($tag) . "',";
     }
     $SQLtag = 'SELECT url, label FROM tag WHERE url IN (' . trim($tag_urls, ",") . ')';
     $tag_from_db = array();
     if ($result = \db::query($SQLtag)) {
         foreach ($result as $row) {
             $tag_from_db[$row["url"]] = $row["label"];
         }
     }
     $SQLinsert = 'INSERT INTO tag (url, label) VALUES (:url, :label)';
     $SQLupdate = 'UPDATE media SET tag = :tag WHERE id = :id';
     if ($tags) {
         foreach ($tags as $tag) {
             $tag = trim($tag);
             if (isset($tag_from_db[$tag])) {
                 $return .= '<a href="?tag=' . $tag . '" rel="tag">' . $tag_from_db[$tag] . '</a>, ';
             } elseif ($tag) {
                 $url = \runner::toAscii(strtolower($tag));
                 if (\db::insert($SQLinsert, array(":url" => $url, ":label" => $tag))) {
                     $tag_property = str_replace($tag, $url, $tag_property);
                     \db::query($SQLupdate, array(":tag" => $tag_property, ":id" => \model::property("table_id")));
                     $return .= '<a href="?tag=' . $url . '" rel="tag">' . $tag . '</a>, ';
                 }
             }
         }
         $return = trim($return, ", ");
         $return .= '</span>';
     }
     if (\runner::config("mode") == "backend") {
         $return .= '<select name="tag" id="tag-' . $model->reference . '" class="frm input form-control" multiple="multiple" style="display: none;">' . PHP_EOL;
         $SQL = 'SELECT url, label FROM tag ORDER BY url';
         if ($options = \db::query($SQL)) {
             foreach ($options as $option) {
                 $selected = in_array($option["url"], $tags) ? ' selected="selected"' : '';
                 $return .= '	<option value="' . $option["url"] . '"' . $selected . '>' . $option["label"] . '</option>' . PHP_EOL;
             }
         }
         $return .= '</select>' . PHP_EOL;
         //$return .= '<link rel="stylesheet" type="text/css" href="' . \runner::config("BASE") . 'Routerunner/metronic/assets/global/plugins/select2/select2.css"/>' . PHP_EOL;
     }
     return $return;
 }
开发者ID:RetroscopeCreative,项目名称:RouterunnerDemo,代码行数:53,代码来源:runner-config.php

示例3: session_start

<?php

/**
 * Created by PhpStorm.
 * User: csibi
 * Date: 2015.02.26.
 * Time: 20:39
 */
session_start();
require $_SESSION["runner_config"]['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $_SESSION["runner_config"]["SITEROOT"] . $_SESSION["runner_config"]["BACKEND_ROOT"] . 'Routerunner/Routerunner.php';
use Routerunner\Routerunner as runner;
$post = array_merge($_GET, $_POST);
new runner(array('mode' => 'backend', 'params' => $post, 'silent' => true, 'method' => 'any', 'resource' => '/', 'bootstrap' => false), function () use($post) {
    $response = array("ascii" => null);
    if (isset($post["str"])) {
        $ascii = \runner::toAscii(strip_tags($post["str"]));
    }
    if (isset($post["reference"])) {
        $SQL = "SELECT rewrite_id, reference FROM `{PREFIX}rewrites` WHERE (url = :url OR resource_uri = :url) AND (reference IS NULL OR reference <> :reference)";
        $params = array(":url" => trim($ascii), ":reference" => $post["reference"]);
        if (\db::query($SQL, $params)) {
            $ascii .= "-" . strftime("%Y%m%d-%H%M%S");
        }
    }
    $response["ascii"] = $ascii;
    echo json_encode($response);
});
开发者ID:RetroscopeCreative,项目名称:RouterunnerCMS,代码行数:27,代码来源:label2ascii.php

示例4: array_merge

<?php

/**
 * Created by PhpStorm.
 * User: csibi
 * Date: 2015.06.05.
 * Time: 21:43
 */
require '../runner-config.php';
require '../' . \runner::config("BACKEND_DIR") . '/Routerunner/Routerunner.php';
use Routerunner\Routerunner as runner;
$files = array_merge($_FILES);
new runner(array('mode' => 'backend', 'params' => $files, 'method' => 'post', 'resource' => '/', 'bootstrap' => false), function () use($files) {
    //require_once($_SESSION["runner_config"]['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $_SESSION["runner_config"]["SITEROOT"] . $_SESSION["runner_config"]["BACKEND_ROOT"] . 'backend/thirdparty/' . 'DiacriticsRemovePHP/diacriticsRemove.php');
    if (!empty($files)) {
        $tempFile = $files['file']['tmp_name'];
        $targetPath = dirname(__FILE__) . DIRECTORY_SEPARATOR;
        //$targetFilename = str_replace(array(" ", "+"), "-", removeDiacritics($files['file']['name']));
        $targetFilename = \runner::toAscii($files['file']['name']);
        $targetFile = $targetPath . $targetFilename;
        move_uploaded_file($tempFile, $targetFile);
    }
    echo $targetFilename;
});
开发者ID:RetroscopeCreative,项目名称:RouterunnerCMS,代码行数:24,代码来源:index.php


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