Jump to content

Archived

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

php_begins

how write code in a zend framework

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?

Share this post


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

Share this post


Link to post
Share on other sites
Does it mean i can no longer create forms in the normal fashion like this:

 

No, you can create form normally if you wish.

Share this post


Link to post
Share on other sites

ok thanks..the whole thing seemed kind of overwhelming to me.like adding external stylesheets,writing jquery code using their view controllers etc..

Share this post


Link to post
Share on other sites

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