本文整理匯總了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();