cakephp-2.0

space between the radio button and label Cakephp

ε祈祈猫儿з 提交于 2021-02-19 07:51:13
问题 i am newbie in Cakephp trying to create a space between radio box and a label <span class="label"><b>Gender</b></span> <?php $options=array('M'=>'Male'."<br>" , 'F'=>'Female'); $attributes=array('legend'=>false,'label'=>'gender_male.','class'=>'radio'); echo $this->Form->radio('gender',$options,$attributes);?> </div> i have created a radio box in Cakephp but there is no space between the box and label is coming ... how can i create a space . 回答1: Try it <span class="label"><b>Gender</b></span

PHP Fatal error: You must enable the intl extension to use CakePHP. in C:\xampp\htdocs\Cakecrud\config\requirements.php on line 31

主宰稳场 提交于 2020-07-16 09:40:25
问题 I have enabled both in php.ini extension= intl extension= php_intl.dll Still the error is same when I run the command on cmd Cake bake all students 回答1: It sounds like you might have added the intl exension to the wrong php.ini file. It needs to be added to the web php.ini file, not cli. To check what extensions are loaded for the web, write phpinfo();exit; in a PHP file then hit hit. To see whats loaded in PHP cli (where you may have added it by mistake), run php -m at a terminal. 来源: https:

How can I use different model for Auth component in CakePHP 2.0.4?

夙愿已清 提交于 2020-02-24 12:32:08
问题 It looks like trivial thing, but I really can't find where I can change it. I want to use my "Player" model instead of User, but every time I go on /players/login it redirects me to "Missing Controller" page and link changes to /users/login. I tried: public $components = array( 'Session', 'Auth' => array( 'authenticate' => array('all' => array('userModel' => 'Player')) ) ); and function beforeFilter() { $this->Auth->authenticate = array('all' => array('userModel' => 'Player')); } EDIT: SOLVED

Cakephp image -Can not determine the mimetype

放肆的年华 提交于 2020-01-23 07:00:27
问题 cakephp 2.3 I'm uploading an image and I have an error saying that: Can not determine the mimetype. Error: An Internal Error Has Occurred. On my Model this is a part of my $validation 'file_name' => array( 'uploadError' => array( 'rule' =>'uploadError', 'message' => 'Your image upload failed', 'allowEmpty' => FALSE, //'required' => false, //'last' => false, // Stop validation after this rule //'on' => 'create', // Limit validation to 'create' or 'update' operations ), 'mimeType' => array(

How to increase the login time for cakephp 2

扶醉桌前 提交于 2020-01-17 13:57:22
问题 Can you please let me know how to increase the session expiry time for CakePHP 2? Currently, i set the configuration as bellow. Configure::write('Session', array( 'defaults' => 'php', 'timeout' => 129600, // The session will timeout after 30 minutes of inactivity 'cookieTimeout' => 129600, // The session cookie will live for at most 24 hours, this does not effect session timeouts 'ini' => array( 'session.gc_maxlifetime' => 129600 // 36 hours ) )); But, these settings not work and session

dispatcher calls code from another app occasionally

拥有回忆 提交于 2020-01-17 12:36:46
问题 We just upgraded some of our apps (from 1.3) to cakephp 2.2 and refactored the code. our basic server setup looks like htdocs/subdomain.domain/cakeapp1/... htdocs/subdomain.domain/cakeapp2/... sometimes we receive errors, which are due to the problem, that cake internally decides to call code from within another app folder. so, we call a route from cakeapp1 and all of a sudden, in the middle of the stack trace, cake calls files from cakeapp2. so, although no code in cakeapp1 references the

How do I access a logged in users phone number in cakephp?

限于喜欢 提交于 2020-01-17 03:24:42
问题 I am using cakephp 2.8, I want to access the logged in users phone number , is there any quick way of doing this? Without using: $this->User->find(all,conditions); conditions=array(Authcomponent::user('id')== 'Profile.user_id') I don't want to use the above code, is there a code like: $this->AuthComponent::user->profile Just a like of code that I can use to get the phone number of a user which is in the profile table. 回答1: If you want to do that in view , just do: $phone = $this->Session-

How should HTTP Post look like for saving model and associated model data?

雨燕双飞 提交于 2020-01-17 00:30:46
问题 I am using Cakephp 2.4.5. I have 2 tables with a one-to-many relationship. Table B belongs to Table A. I want a controller in Table A that can save records in Table A and Table B. The controller code should be simple and looks like this; public function add_tableA($id=null) { if ($this->request->is('post')) { $this->layout = null ; $this->TableA->create(); $this->TableA->saveAll($this->request->data, array('deep' => true)); } } My problem comes when trying to send the right HTTP POST format

How should HTTP Post look like for saving model and associated model data?

萝らか妹 提交于 2020-01-17 00:29:08
问题 I am using Cakephp 2.4.5. I have 2 tables with a one-to-many relationship. Table B belongs to Table A. I want a controller in Table A that can save records in Table A and Table B. The controller code should be simple and looks like this; public function add_tableA($id=null) { if ($this->request->is('post')) { $this->layout = null ; $this->TableA->create(); $this->TableA->saveAll($this->request->data, array('deep' => true)); } } My problem comes when trying to send the right HTTP POST format