Jump to content

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',
        ));

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.