cakephp-2.0

cakephp checkbox is showing extra hidden field

☆樱花仙子☆ 提交于 2020-01-03 19:59:28
问题 foreach($apps as $app){ echo $this->Form->input('Application', array('type'=>'checkbox', 'id'=>$app['Application']['description'], 'div'=>false,'type'=>'checkbox','value' => $app['Application']['description'],'label'=>$app['Application']['description'])); } <div class="checkboxes"> <input type="hidden" name="data[Group][Application]" id="GG_" value="0"/><input type="checkbox" name="data[Group][Application]" id="GG" value="GG"/><label for="GG">GG</label><input type="hidden" name="data[Group]

cakephp checkbox multiple select just sends the value of last selected checkbox

社会主义新天地 提交于 2020-01-03 17:45:24
问题 I am not getting the value of all the checkboxes selected. It just gives me the value of last selected checkbox here is the code foreach($apps as $app){ echo $this->Form->input('Application.id', array('type'=>'checkbox','multiple' => 'checkbox' , 'id'=>$app['Application']['description'], 'div'=>false,'type'=>'checkbox','value' => $app['Application']['description'],'label'=>$app['Application']['description'])); } and on submit I get the very last checkbox which is LASTCHECKBOX object

CakeResponse Download file is not working

…衆ロ難τιáo~ 提交于 2020-01-03 05:39:26
问题 I am writing a simple application with cakePHP 2.x. I need to allow user to uplaod and download files. The Upload works fine, but the i'm stuck with the download action. I have a Controller name Documents, containing the Download action: public function download($id = null) { $this->Document->recursive = -1; $doc = $this->Document->find('first', array('conditions' => array('Document.id' => $id))); $filename = $doc['Document']['file_file_name']; $resp = new CakeResponse(); $resp->download

CakePHP 2.0: ACL not working

拈花ヽ惹草 提交于 2020-01-03 01:28:19
问题 I have used ACL in CakePHP 1.3 without a single issue, after 2 weeks of bitter frustrations it still does not work in CakePHP 2.0. I have followed the Cake ACL tutorial EXACTLY, but nothing happens. All Aros are in correctly, same for ACOS and permissions. After all this, I can enter all denied actions without a problem. Hereby my AppController: public $components = array('Acl','Auth'=> array( 'authenticate' => array( 'Actions', 'Form' => array( 'fields' => array('username' => 'email') ), ) )

Add a new translatable field to an existing translatable table in CakePHP 2.2

此生再无相见时 提交于 2020-01-02 23:35:33
问题 I'm using CakePHP's translatable behavior. I have a few existing fields working fine, but I'm having trouble adding a new translatable field to my model. CakePHP uses an INNER JOIN to fetch all translatable fields from the database. Now, if I add an extra translatable field to my model, all the translation records for that field won't exist in the database. And because of the inner join, whenever it tries to fetch ANY existing records from the database, it will return blank - because the

cakephp HABTM same model

二次信任 提交于 2020-01-02 12:44:52
问题 I have a site develop in cakephp 2.0 I want to make a HABTM relation to the same model: A product can has more products. I thinked to do in this mode into my model: class Product extends AppModel { public $name = 'Product'; public $useTable = 'products'; public $belongsTo = 'User'; public $actsAs = array('Containable'); public $hasAndBelongsToMany = array( 'Ingredient' => array( 'className' => 'Product', 'joinTable' => 'ingredients_products', 'foreignKey' => 'product_id',

cakephp HABTM same model

萝らか妹 提交于 2020-01-02 12:41:23
问题 I have a site develop in cakephp 2.0 I want to make a HABTM relation to the same model: A product can has more products. I thinked to do in this mode into my model: class Product extends AppModel { public $name = 'Product'; public $useTable = 'products'; public $belongsTo = 'User'; public $actsAs = array('Containable'); public $hasAndBelongsToMany = array( 'Ingredient' => array( 'className' => 'Product', 'joinTable' => 'ingredients_products', 'foreignKey' => 'product_id',

Changing password with CakePHP and blowfish

最后都变了- 提交于 2020-01-01 12:45:28
问题 I'm trying to set up a form to allow a user to change their password using CakePHP 2.3. The algorithm being used is blowfish. I have the following three fields: <?php echo $this->Form->input('old_password', array('type' => 'password', 'autocomplete' => 'off')); ?> <?php echo $this->Form->input('new_password', array('type' => 'password', 'autocomplete' => 'off')); ?> <?php echo $this->Form->input('new_password_confirm', array('type' => 'password', 'autocomplete' => 'off', 'label' => 'Confirm

Unexpected error communicating with Stripe

我怕爱的太早我们不能终老 提交于 2020-01-01 09:05:35
问题 Billing with Stripe i have a form and i submit information and place the order following error has occured.... Unexpected error communicating with Stripe. If this problem persists, let us know at support@stripe.com. (Network error [errno 77]: error setting certificate verify locations: CAfile: C:\xampp\htdocs\PhpProject2\app\Lib\Stripe/../data/ca-certificates.crt CApath: none ) my controller action code if(!empty($this->request->data)){ $email = $this->request->data['email']; $credit_card =

Connecting cakephp 2.0 with PostgreSQL

一个人想着一个人 提交于 2019-12-31 06:02:32
问题 I am using cakephp 2.0 and a wamp server. I have enabled the pdo of postgres in the php and i tried connecting to Postgres. However it still says that there is an error. My login and password is also double confirmed. Below is codes for the database.php file: public $default = array( 'datasource' => 'Database/Postgres', 'persistent' => false, 'host' => 'localhost', 'port' => '5432', 'login' => 'postgres', 'password' => 'password', 'database' => 'Test', 'schema' => '', 'prefix' => '',