Jump to content

Search the Community

Showing results for tags 'views'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 2 results

  1. View is not displaying error messages.Validation done at model level My view is add.ctp <?php echo $this->Session->Flash(); foreach($this->form->validationerrors as $errors) { echo $errors['Publishers']; } if(isset($updates)) { $id=$updates['Agreement']['id']; $pubname=$updates['Agreement']['publisherid']; } echo $this->Form->create('Agreement', array('action' => 'add', 'type' => 'file')); //echo $this->Form->file('File'); echo "<table><tr><td>Publisher Name</td><td>".$this->Form->input('Publishers',array('label'=>false,'default'=>@$pubname))."</td></tr>"; echo "<tr><td>Agreement File</td><td>".$this->Form->file('File',array('label'=>false))."</td></tr>"; echo "<tr><td colspan='2'>".$this->Form->input('id',array('label'=>false,'default'=>@$id,'type'=>'hidden'))."</td></tr>"; echo "<tr><td colspan='2'>".$this->Form->submit('Upload',array('label'=>false,'after' => $this->Html->link('Cancel', array('action' => 'view'))))."</td></tr></table>"; echo $this->Form->end(); ?> Model is <?php //License Agreements //Created By Dharmender On 8-2-2013 class Agreement extends AppModel { var $name = 'Agreement'; var $validate=array( 'Publishers' => array( 'rule' => 'notEmpty', 'message' => 'Please enter publisher name.' )); } ?> Controller is <?php class AgreementsController extends AppController { var $name = 'Agreements'; var $components = array('Session'); function add($id=null) { if($id!=null) { $updates=$this->Agreement->findById($id); $this->set('updates',$updates); } if(@$this->request->data['Agreement']['id']==NULL) { $this->Agreement->create(); if (!empty($this->request->data) && is_uploaded_file($this->request->data['Agreement']['File']['tmp_name'])) { $fileData = fread(fopen($this->request->data['Agreement']['File']['tmp_name'], "r"), $this->request->data['Agreement']['File']['size']); $this->request->data['Agreement']['name'] = $this->request->data['Agreement']['File']['name']; $this->request->data['Agreement']['type'] = $this->request->data['Agreement']['File']['type']; $this->request->data['Agreement']['size'] = $this->request->data['Agreement']['File']['size']; $this->request->data['Agreement']['data'] = $fileData; if($this->request->data['Agreement']['Publishers']=='ram') { $id2=1; } else { $id2=2; } $this->request->data['Agreement']['publisherid']=$id2; $this->request->data['Agreement']['createdon'] = date ('Y-m-d H:i:s'); if($this->Agreement->save($this->data)) { $this->Session->setFlash('File Uploaded Successfully!'); $this->Redirect('view'); } else { $this->Session->setFlash('Error in File Uploading!'); } } } else { $this->Agreement->id=$this->request->data['Agreement']['id']; if (!empty($this->request->data) && is_uploaded_file($this->request->data['Agreement']['File']['tmp_name'])) { $fileData = fread(fopen($this->request->data['Agreement']['File']['tmp_name'], "r"), $this->request->data['Agreement']['File']['size']); $this->request->data['Agreement']['name'] = $this->request->data['Agreement']['File']['name']; $this->request->data['Agreement']['type'] = $this->request->data['Agreement']['File']['type']; $this->request->data['Agreement']['size'] = $this->request->data['Agreement']['File']['size']; $this->request->data['Agreement']['data'] = $fileData; if($this->request->data['Agreement']['Publishers']=='ram') { $id2=1; } else { $id2=2; } $this->request->data['Agreement']['publisherid']=$id2; $this->request->data['Agreement']['createdon'] = date ('Y-m-d H:i:s'); if($this->Agreement->save($this->data)) { $this->Session->setFlash('Record Updated Successfully!'); $this->Redirect('view'); } else { $this->Session->setFlash('Error in File Updating!'); } } } }
  2. Hello, am writing a video tutorial using cakephp. I have tried to embed my swf player using Javascript code. It works fine in all the index view of all my controllers but don't in other action/view. What could possibly be the problem. Any help would be appreciated
×
×
  • 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.