本文整理汇总了PHP中Flash::run方法的典型用法代码示例。如果您正苦于以下问题:PHP Flash::run方法的具体用法?PHP Flash::run怎么用?PHP Flash::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Flash
的用法示例。
在下文中一共展示了Flash::run方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($action_name, $params=[], $method= "GET"){
$this->action_name= $action_name;
$this->method= $method;
$this->params= $params;
if(!is_callable([$this, $action_name]))
throw new ActionNotDefined;
Flash::run();
if(is_callable([$this, "before_action"]))
$this->before_action();
$this->$action_name();
if($this->rendered())exit;
$this->render();
}
示例2: run
*/
public function run()
{
if (!strlen($this->strId)) {
return;
}
$this->import('String');
$this->import('Database');
$objArticle = $this->Database->prepare("SELECT * FROM tl_flash WHERE flashID=?")->limit(1)->execute($this->strId);
if ($objArticle->numRows < 1) {
$this->log('Could not find a content element with flashID "' . $this->Input->post('flashID') . '"', 'Flash run()', TL_ERROR);
echo 'content=<p class="error">Could not find element "' . $this->Input->post('flashID') . '"!</p>';
return;
}
// Strip all tags that Flash can not handle
$ce = $this->String->decodeEntities($objArticle->content);
$ce = strip_tags($ce, '<a><b><br><font><img><i><li><p><span><textformat><u>');
// Convert <br /> to <br> and remove all line-breaks as they might get transformed into additional <br> tags
$ce = preg_replace('/<br \\/>/i', '<br>', $ce);
$ce = preg_replace('/[\\n\\r]+/i', '', $ce);
$objTemplate = new FrontendTemplate('mod_flash_content');
$objTemplate->text = 'content=' . trim(urlencode($ce));
echo $objTemplate->parse();
}
}
/**
* Instantiate controller
*/
$objFlash = new Flash();
$objFlash->run();