本文整理汇总了PHP中HtmlElement::init方法的典型用法代码示例。如果您正苦于以下问题:PHP HtmlElement::init方法的具体用法?PHP HtmlElement::init怎么用?PHP HtmlElement::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HtmlElement
的用法示例。
在下文中一共展示了HtmlElement::init方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
function init()
{
parent::init();
$this->set('Problem Loading Google Map');
$url = 'http://maps.google.com/maps?file=api&v=2&key=' . $this->api->getConfig('map/google/key', 'ABQIAAAA1dw0K5D0tpWLBbZ-SCh2YBS8lnDegradZ_LGHIBXZSRvdsbN5BQJtPnF1vFmNBWgvU-R-TiiESQV2g');
$this->api->template->append('js_include', '<script type="text/javascript" src="' . $url . '"></script>' . "\n");
}
示例2: init
function init()
{
parent::init();
$this->setElement('img');
$this->setAttr('src', $this->api->locateURL('template', 'images/PinkElephant.jpg'));
$this->set('');
}
示例3: init
function init()
{
parent::init();
$this->set('Problem Loading Google Map');
$url = 'http://maps.googleapis.com/maps/api/js?key=' . $this->api->getConfig('map/google/key', '') . '&sensor=true';
$this->api->template->appendHTML('js_include', '<script type="text/javascript" src="' . $url . '"></script>' . "\n");
$this->js(true, ' var map = new google.maps.Map(document.getElementById("' . $this->name . '"),{zoom: 8, center: new google.maps.LatLng(-34.397, 150.644), mapTypeId: google.maps.MapTypeId.ROADMAP});');
}
示例4: init
function init()
{
parent::init();
if (!$this->api->template->is_set('js_include')) {
return;
}
// no support in templtae
$this->set($v = $this->api->getVersion());
if ($v[0] != 4) {
return;
}
// probably not ATK version
if (isset($_COOKIE[$this->name . '_' . str_replace('.', '_', $v)])) {
return;
}
$this->api->template->append('js_include', '<script aync="true" onload="try{ atk4_version_check(\'' . $this->name . '\'); } catch(e){ }" type="text/javascript" src="http://agiletoolkit.org/upgrade_check/' . $this->api->getVersion() . '.js"></script>' . "\n");
}
示例5: init
function init()
{
parent::init();
$this->add('H4')->set('The Hangman Game');
if (!$_GET[$this->name]) {
$this->add('P')->set('Select Difficulty');
$f = $this->add('Form');
$f->addField('radio', 'difficulty')->setValueList(array(10 => 'Easy', 5 => 'Medium', 3 => 'Hard'));
$f->addSubmit('Start Game');
if ($f->isSubmitted()) {
$this->memorize('word', 'back');
$this->memorize('tries', $f->get('difficulty'));
$this->memorize('letters', range('a', 'z'));
$this->js()->reload(array($this->name => 1))->execute();
}
return;
}
$letter = $_GET[$this->name];
$word = $this->recall('word');
$tries = $this->recall('tries');
$letters = $this->recall('letters');
$this->api->stickyGET($this->name);
if ($letter != 1) {
unset($letters[array_search($letter, $letters)]);
if (strpos($word, $letter) === false) {
$tries--;
}
$this->memorize('tries', $tries);
$this->memorize('letters', $letters);
}
$word = str_replace($letters, '-', $word);
if ($tries < 0) {
$this->add('P')->set('Game Over');
return;
}
if (strpos($word, '-') === false) {
$this->add('P')->set('You won!');
return;
}
$this->add('P')->set('Mistakes remaining: ' . $tries);
foreach ($letters as $i) {
$l = $this->add('HtmlElement')->setElement('a')->setAttr('href', '#')->set(strtoupper($i))->js('click', $this->js()->reload(array($this->name => $i)));
}
$this->add('P')->set('Word: ' . $word);
}
示例6: init
function init()
{
parent::init();
$this->set($this->default_text);
$this->addClass('password-checker');
$field = $this->owner;
if (!$field instanceof Form_Field) {
throw $this->exception('You should use StrengthChecker by inserting it into password field');
}
$field->js('change')->univ()->ajaxec(array($this->api->url(), $this->name => $field->js()->val()));
$field->js(true)->univ()->autoChange(1000);
if (isset($_GET[$this->name]) || isset($_POST[$this->name])) {
$p = $_POST[$this->name] ? $_POST[$this->name] : $_GET[$this->name];
// Check
if ($p) {
$out = $this->checkByCrackLib($_GET[$this->name]);
} else {
$out = '';
}
$this->setResponse($p, $out);
}
}
示例7: init
function init()
{
parent::init();
$this->setElement('H3');
}
示例8: init
function init()
{
parent::init();
$this->addClass('atk-buttonset atk-inline');
}
示例9: init
public function init()
{
parent::init();
$this->setElement('form');
}
示例10: init
function init()
{
parent::init();
$this->setElement('div')->addClass('hr')->set('');
}
示例11: init
public function init()
{
parent::init();
$this->setElement('hr')->set('');
}
示例12: init
protected function init()
{
parent::init();
list($y, $m, $d) = explode('-', date('Y-m-d'));
$this->setYear($y);
$this->setMonth($m);
$this->setDay($d);
if (null == $this->maxDate) {
$this->maxDate = intval(date('Y')) + 50 . date('-m-d');
}
if (null == $this->minDate) {
$this->minDate = intval(date('Y')) - 50 . date('-m-d');
}
}
示例13: init
function init()
{
parent::init();
$this->add('Icon')->set($this->icon)->setColor('nobg');
}