cakephp-2.1

cakephp loses sessions when using safari and internet explorer

杀马特。学长 韩版系。学妹 提交于 2019-12-04 17:08:17
I'm using ajax and sessions for a cakephp project but it looks like the session gets lost when I use either safari or IE. I've followed the solutions in Sessions in IE and cakephp 1.3 not working properly when saving via AJAX I've set my core.php files to the settings below. Configure::write('Session.checkAgent', false); Configure::write('Security.level', 'low'); I've already upgraded my cake version to 2.3.0 and I'm still having the same issues. Please help? Thank you. Here are my pastebins jscript http://pastebin.com/WDCaTkEH php - http://pastebin.com/YL7qkLf0 there seems to be something

CakePHP 2.1.0: How to Create “Down for Maintenance” Page

我与影子孤独终老i 提交于 2019-12-04 13:25:46
问题 I'm trying to implement something like Mark Story's "Down for Maintenance" page using CakePHP 2.1.0. I'm pretty close to achieving this, but I'm running into two issues that I could use some help with. First of all, here is all of the relevant code (six files): 1) app/Config/bootstrap.php: Configure::write('App.maintenance', true); 2) app/Config/core.php: Configure::write('debug', 1); ... Configure::write('Exception', array( 'handler' => 'ErrorHandler::handleException', 'renderer' =>

CakePHP 2 $this->Html->script order

你离开我真会死。 提交于 2019-12-04 08:36:13
I am trying to insert JS files into the view but they are being inserted in the wrong order. In my default.ctp I have this $this->Html->script(array( 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js', 'global' ), array('inline'=>false)); echo $this->fetch('script'); In my view I have this: $this->Html->script('jquery.fancybox.pack', array('inline' => false)); But when I view the source it comes out like this: <script type="text/javascript" src="/js/jquery.fancybox.pack.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery

Cakephp 2.1 naming convensions issue in version change

我的梦境 提交于 2019-12-04 05:48:15
问题 I have just installed CakePHP 2.1. And just see that the naming convention of its is just change lot from the older version which making me crazy. Like it was app/controllers while now it is app/Controller same way app/models - app/Model app/views - app/View I know there must be some advantage on doing this. But my problem is when I use the cake bake it is creating directory in the same old fashion i.e. controllers/models/views . Which is no more accessible from the URL & obviously will throw

Cakephp can't change database on-the-fly

。_饼干妹妹 提交于 2019-12-04 04:29:35
问题 I am trying to connect from multiples databases from a loop, but seens CakePHP can't change database , only others infos (like user/pass/host). app/Config/database.php <?php class DATABASE_CONFIG { [...] public $default = array( [..] // Where I have the companies ); public $client = array( [...] // Fakke settings, because I will change it on-the-fly ); } app/Controller/CronController.php $companies = $this->Company->find('all'); foreach($companies as $company) { $settings = array( 'datasource

Using email instead of username in CakePHP Auth Component

混江龙づ霸主 提交于 2019-12-04 03:54:39
问题 I am working on cakephp 2.x . my problem is i dont want to use username for logging .. i am taking the email and password from the user and verify this email and password from the database i have a table in my database name user and it has 3 fields id , email and password here is my code Model <?php class User extends AppModel { public $useTable = 'user'; } ?> AppController class AppController extends Controller { public $components = array( 'Session', 'Auth'=>array( 'loginRedirect'=>array(

cakephp doesn't work url-rewriting on Ubuntu

天大地大妈咪最大 提交于 2019-12-04 01:32:19
all. This time I try cakephp, but I have got "URL rewriting is not properly configured on your server. 1) Help me configure it 2) I don't / can't use URL rewriting". I could know this is apache and .htaccess issues such as /etc/apache2/sites-avaliable/default and each directory .htaccess. My development environment... Ubuntu12.04 on vmware fusion4 apache2.2.22 mysql5.5 php5.3.10 cakephp2.1 My process is followed... 1)/etc/apache2/httpd.conf <Directory /> Options FollowSymLinks AllowOverride All </Directory> 2)enabling mod_rewrite sudo a2enmod rewrite sudo service apache2 reload 3)editing /etc

Validating multiple fields with the same name

ぃ、小莉子 提交于 2019-12-03 23:07:14
问题 I have a view file that looks like this: <?php echo $this->Form->create('ModelName'); echo $this->Form->input('ModelName.0.firstField'); echo $this->Form->input('ModelName.0.secondField'); echo $this->Form->input('ModelName.1.firstField'); echo $this->Form->input('ModelName.1.secondField'); echo $this->Form->end(); ?> My question is, how do I validate this data? I'm not saving, so it seems pointless to me to call the save or saveAll methods. I just want to validate the data before I process

CakePHP: Creating new HABTM row instead updates other

╄→尐↘猪︶ㄣ 提交于 2019-12-03 17:09:07
I have two models with a HABTM (Has and belongs to many) relationship: Qsets and Questions. The following action (in QsetsController.php) should result in a new row in the qsets_questions table, with the new question appearing in the new qset. But instead it updates existing rows, resulting in that question begin taken from a previous qset and added to the new one. What am I doing wrong? public function admin_add_question( $qset_id, $question_id) { //find the qset... $qset = $this->Qset->find('first', array('id'=>$qset_id)); $this->Qset->QsetsQuestion->create(); $data = array( "Qset"=> array (

Best way to implement admin panel in CakePHP

南笙酒味 提交于 2019-12-03 14:56:40
I am trying to move from CodeIgniter to CakePHP and can't figure out the best way to implement an admin panel. In CI I would create two different applications, one for the frontend and one for the admin panel. After Googling around, I have found three ways to implement admin panel in CakePHP: Routing - I don't want to use this as I want by Controllers/Models to be separate for frontend and admin panel Plugin Two separate apps Should I use plugin to implement admin panel or should I have separate apps? Any benefits of one over the other? I normally develop the admin/backend as a plugin. This