Jump to content

how write code in a zend framework


php_begins

Recommended Posts

Alright, I have to start writing PHP,jquery,css code using the ZEND framework. The  framework is already set up by my supervisor. I do not have any knowledge regarding the ZEND framework.

For example ,normally the structure of my code would look something like this:

 

<srcript type="text/javascript src="some_external_jqueryl_ibrary">
//jquery.ajax function()
</script>
<link rel="stylesheet" type="text/css" href="theme.css" />
<html>
<form>
<div id="something">
</div>
</form>
<?
//PHP code
?>

Is there a tutorial as how to write code and structure them in a ZEND framework?

Link to comment
https://forums.phpfreaks.com/topic/256149-how-write-code-in-a-zend-framework/
Share on other sites

Thank you. I had a look at it. Does it mean i can no longer create forms in the normal fashion like this:

<form action="test.php" method ="POST">
<!-- Code here -->
</form

 

Do i need to use oop like this everytime:

class Application_Form_Test extends Zend_Form
{
    public function init()
    {
        // Set the method for the display form to POST
        $this->setMethod('post');

        // Add an email element
        $this->addElement('text', 'email', array(
            'label'      => 'Your email address:',
            'required'   => true,
            'filters'    => array('StringTrim'),
            'validators' => array(
                'EmailAddress',
            )
        ));

        // Add the comment element
        $this->addElement('textarea', 'comment', array(
            'label'      => 'Please Comment:',
            'required'   => true,
            'validators' => array(
                array('validator' => 'StringLength', 'options' => array(0, 20))
                )
        ));

       
        // Add the submit button
        $this->addElement('submit', 'submit', array(
            'ignore'   => true,
            'label'    => 'Sign Guestbook',
        ));

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.