zend framework: zend form create multiply radio buttons
By : Cim
Date : March 29 2020, 07:55 AM
|
how to create and return with ajax an xml file on zend framework
By : mecroze
Date : March 29 2020, 07:55 AM
it should still fix some issue I don't know whether you know or not zend framework has an action helper context switch to help resolve exposing different data formats this code snippet is collected from http://www.zfsnippets.com/snippets/view/id/48 code :
## /application/controllers/EnglandController.php
<?php
/**
* Simple example of using the context switch
*
* @author Dave Marshall
*/
class EnglandController extends Zend_Controller_Action
{
public function init()
{
$this->_helper->contextSwitch()
->addActionContext('a', array('xml', 'json'))
->setAutoJsonSerialization(true)
->initContext();
}
public function aAction()
{
$this->view->team = 'a';
$this->view->players = array(
'David James',
'Ashley Cole',
'John Terry',
'Rio Ferdinand',
'Glen Johnson',
'Joe Cole',
'Steven Gerrard',
'Frank Lampard',
'David Beckham',
'Wayne Rooney',
'Michael Owen',
);
}
}
## /application/views/scripts/england/a.xml.phtml
<?php echo "<?xml version="1.0" ?>";?>
<team>
<name><?php echo $this->team; ?></name>
<players>
<?php foreach($this->players as $player):?>
<player><?php echo $player; ?></player>
<?php endforeach; ?>
</players>
</team>
## http://yourhost/england/a/format/xml would output
<?xml version="1.0" ?><team>
<name>a</name>
<players>
<player>David James</player>
<player>Ashley Cole</player>
<player>John Terry</player>
<player>Rio Ferdinand</player>
<player>Glen Johnson</player>
<player>Joe Cole</player>
<player>Steven Gerrard</player>
<player>Frank Lampard</player>
<player>David Beckham</player>
<player>Wayne Rooney</player>
<player>Michael Owen</player>
</players>
</team>
## http://yourhost/england/a/format/json would output
{
"team":"a",
"players":[
"David James",
"Ashley Cole",
"John Terry",
"Rio Ferdinand",
"Glen Johnson",
"Joe Cole",
"Steven Gerrard",
"Frank Lampard",
"David Beckham",
"Wayne Rooney",
"Michael Owen"
]
}
|
How to create Log File on hourly basis in Zend Framework 1.1
By : user3300972
Date : March 29 2020, 07:55 AM
Does that help I have created log file on day basis but on day basis content have huge amount of data and difficult to download and open so i want to create on hour basis , Try this, In this case, a new file will be created each second. code :
<param name="datePattern" value="Y-m-d.H.i.s" />
<param name="datePattern" value="Y-m-d.H" />
|
Zend Framework 3: create download link for generated file
By : Scarab
Date : March 29 2020, 07:55 AM
seems to work fine for the help, I managed to figure it out over the weekend. Here's how I did it: code :
$filename = join(DIRECTORY_SEPARATOR, array($dldir, $formData['upload']['name']));
$objWriter->save(str_replace(__FILE__,$filename,__FILE__));
return $this->redirect()->toRoute('import', ['action' => 'reject'],['query' => ['q' => 'file', 'name' => $filename]]);
public function rejectAction()
{
$filename = $this->getRequest()->getQuery('name', null);
return new ViewModel(array('filename' => $filename));
}
<a href="<?php echo $this->filename; ?>">Right-click here and choose 'Save As' to download your file.</a>
|
How to create a simple button with javascript to call a zend action in zend framework?
By : Rick Jones
Date : March 29 2020, 07:55 AM
|