Questions tagged [cakephp-2.1]

This tag relates to the 2.1.x branch of the CakePHP MVC framework.

CakePHP is a rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications. Using commonly known design patterns like MVC and ORM within the convention over configuration paradigm, CakePHP reduces development costs and helps developers write less code.[1]

The release of CakePHP 2.1 beta was announced on CakePHP official site on 2012-01-23.

The latest CakePHP stable version is 2.1.5 Security Release resolving security issues related to the XML class.

[1] From the CakePHP home page.

1009 questions
6
votes
2 answers

Cakephp ClassRegistry::init in bootstrap

can I use a model in bootstrap.php to get an array with find() from database ? like this : $Setting = ClassRegistry::init('Setting'); $Settings = $Setting->find('all'); thanks
ali786
  • 142
  • 3
  • 10
5
votes
3 answers

CakePHP 2 $this->Html->script order

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' ),…
472084
  • 17,666
  • 10
  • 63
  • 81
5
votes
3 answers

CakePHP 2.1 JsonView

I'm using the new CakePHP 2.1 and would like to use the JsonView to make my controller respond to an AJAX request created by jQuery on the client side. However, this should be done automatically with the JsonView according to the…
Chris De Rouck
  • 127
  • 2
  • 5
5
votes
6 answers

Intercept cake2 postLink() form posts with jQuery

Has anyone found a way to intercept the default Form::postLink() forms with Jquery? I would like the form to work without JS (therefore the postLink). But with JS enabled I want to intercept the post and call it via AJAX.
mark
  • 21,691
  • 3
  • 49
  • 71
5
votes
3 answers

forcibly redirect to correct folder

I am new in htaccess. I updated some SEO pages in my live site after one day some Url changes came so i changed the url again. but google already indexed it. So i want if some one found old url it will redirect to new url But in case of SEO pages…
Ayesha
  • 622
  • 2
  • 5
  • 17
5
votes
2 answers

Defining global conditions in Model

Is it possible to define global conditions for Model ? I have 2 Models: User and Student. In database both of them are using table users but each student has set parent_id to its owner (which is set in the same table) while each user has parent_id…
Ziemo
  • 941
  • 8
  • 27
5
votes
1 answer

how to save specific field in Cakephp

here is my code public function settings(){ $this->loadModel('Userinfo'); $helpers = array('TimeZoneHelper'); if($this->request->is('post')) { $id = $this->Auth->User('idUser'); $data = …
hellosheikh
  • 2,929
  • 8
  • 49
  • 115
5
votes
3 answers

CakePHP validation rule automatically adding a required attribute to the field

I am using a custom validation rule in CakePHP to be sure a value is entered into a field when a corresponding checkbox is marked: Here's the validation rule within my model's validation array... 'tv_price'=>array( 'check'=>array( …
CSamp
  • 113
  • 1
  • 4
  • 10
5
votes
2 answers

CakePHP: How to update multiple records at the same time with the Form helper

On an edit page for the model Test I want to be able to update the "Questions.order" field on all of it's associated (by hasMany) questions from the same form. I've ready the Cake book chapter on saveMany()/saveAll() in the book, and I'm using the…
emersonthis
  • 32,822
  • 59
  • 210
  • 375
5
votes
3 answers

CakePHP 3 step registration

I am trying to create a 3 step registration page withh cakePHP. First step is OK, it inserts the data in db but the second step is not working. Can someone help please? Here is my controller code:
Milos Miskone Sretin
  • 1,748
  • 2
  • 25
  • 46
5
votes
2 answers

Using Oracle database with CakePHP 2.0

I have noticed there's no datasource for Oracle in CakePHP 2.0 for the moment, although it seems they are working on in it now: http://ask.cakephp.org/questions/view/any_news_about_oracle_datasource_with_cakephp_2_0 There are some people explaining…
Alvaro
  • 40,778
  • 30
  • 164
  • 336
5
votes
3 answers

getting result as single dimension array from cakephp query

I am in a situation where in I need to execute some very big queries, 25~30 joins to generate some periodical reports. Now we already have these queries created and working, i just want to reuse them and thus used cake model's query method. say my…
tom _1
  • 73
  • 1
  • 5
5
votes
1 answer

CakePHP 2 Basic Auth Authentication

I am moving from CakePHP 1.3 to CakePHP 2.2.2 and want to use Basic Http authentication for a simple admin area. I am just not able to make it work and I am thinking that I understood something wrong in the documentation. From the documentation I…
Mark
  • 3,389
  • 2
  • 28
  • 52
5
votes
2 answers

What has happened to javascript helper in cakePHP 2?

I have used this item and get this error : Missing Helper Error: JavascriptHelper could not be found. Error: Create the class JavascriptHelper below in file: app/View/Helper/JavascriptHelper.php
MUY Belgium
  • 2,330
  • 4
  • 30
  • 46
5
votes
1 answer

int columns are pulled as string from DB in CakePHP

I'm fairly new to CakePHP, but I find it very easy to use so far. today I've encoutered a problem with data exporting from the db. I'm exporting 1 of my models as JSON. Everything goes pretty well, except that I noticed that CakePHP exports the id…
Dan
  • 872
  • 10
  • 24
1 2
3
67 68