cakephp

how to link javascript to $scripts_for_layout while in an element.

I am currently working on a application that will be implementing user customizable widgets on each users dashboard. The user is able to add and remove widgets at will. Each widget is contained within its own element and some have JavaScript files with need to be loaded individually. The current issue I'm having is if i try and link a J...

Complex SQL Query Help

Given a pretty standard set of related tables like Customers, Invoices and Line Items. I need to make a query like "Select all customers that have invoices that have 5 line items or more" or "Select all customers that have more than 2 invoices" or lastly "Select all customers that have line items totaling more than $100" I'm doing thi...

How to refactor better model functions in CakePHP?

Hi I'm reading programming best practices and it is said that when creating a function we should make it do a only single specific task. I got model functions that retrieves data and it's related data. Example: $this->Student->StudentAssignments(); Currently this function retrieves the student's assignments plus the question for each ...

Cakephp comment form input keeps the same value after i press add

Hello, I've created a blog site from "Beginning CakePHP from novice to professiona"-David Golding. I have the comment view listed below: <div class="comments form"> <?php echo $form->create('Comment');?> <fieldset> <legend><?php __('Add Comment');?></legend> <?php echo $form->input('name'); echo $form->input('cont...

Country/State Dropdown in CakePHP

How do i deal with dependent combo boxes in the views with the form helper. For example: Country Select Box (Choosing a country shall filter out the states of the selected country) States Select Box This should happen with the help of Javascript / Jquery etc. I came across an example for the same with Cake's core AJAX helper but it wou...

How can we added a controller by using WF admin?

My boss give me some assignment to find information "How to add a controller by using wildflower admin (dashboard)? and how can we manipulate it (wf admin)?". I've searches every each google but it's too difficult to find it. Maybe i not so great to do researches job. So, please help me you guys. ...

Unsetting elements of a cakephp generated array

I have an array called $all_countries following this structure: Array ( [0] => Array ( [countries] => Array ( [id] => 1 [countryName] => Afghanistan ) ) [1] => Array ( [countries] => Array ( ...

How to handle index undefined errors in CakePHP?

Hi, I got an old PHP system integrated with a new CakePHP one. The problem is when displaying data I occasionally get index undefined errors meaning the models aren't related to where they're supposed to be maybe because there's no validation. There are gaps resulting into models loosing their relationship with a model I'm expecting henc...

Cake Application Video Tutorial

Anyone know any good cake app build video tutorials? m ...

CakePHP URL with HTML Anchor

I'm using cakePHP 1.2, and wondering how I can handle a URL that dynamically builds the page with a slug, but then links to the appropriate area with an HTML anchor. An example: www.mysite.com/pageSlug#anchor I would parse out the slug, which would be used to dynamically build the page. Once built, I would need to jump to the anchor. A...

How to make CakePHP redirect to a different action/controller?

My situation: The user is presented with a table or list of items. Beside each item they can click a checkbox to select it, and then at the bottom is a select box which says "With selected items...", and things like "delete", "move to project", "download", etc. You know the deal - bulk operations. Some of the operations will execute imm...

Defining Model Relations for ACL Interface (gui) with CakePHP

Hello, I have set up Auth and ACL successfully on my cakePHP app. How, now i want to build an interface for managing the ACL's, ARO's and ACO's ARO's and ACO's where pretty easy to build using the tree behavior. ACL how ever got me a little messed up... especially when it came to defining the model relations. I've named my aco and ar...

Dropdown list with dyanmic optgroup

Hi there cakephp experts! I am looking for you help on a dyanmic dropdown list with dyanamic optgroup. Suppose I have two tables: countries: id, country_name, counties: id, county_name, country_id Now, I want to display a dropdown list with optgroups populated frm countries table and list items populated from counties. country_n...

Cakephp: Abstracting AppController another level, possible?

Hi All, I was wondering if it's somehow possible to add another abstraction controller between AppController and my app's other controllers? So that my controllers, e.g. UsersController extends SecureController and SecureController extends AppController. Also I want to be able to have other controllers extend AppController directly: So...

PHP: Does $_this have a special meaning?

I cant seem to find any documentation on what $_this means in PHP. It seems to be used quite a bit in the CakePHP framework. Any ideas? ...

CakePHP: image inside link, want to make link point to image location

I have some images inside links that I want to essentially look like this: <a href="/path/to/img.png"><img src="/path/to/img.png" /></a> Clicking on the link should load the image it contains. I'm trying to use CakePHP's HTML helper to do this, as follows: <?php echo $html->link( $html->image('img.png'), 'img.png', arra...

How do I access programmatically the url where my index is located in CakePHP?

Ex: echo getMyUrl(); should echo: http://localhost/myapplication ...

cakephp form getting spammed - how?

I have a simple cakephp form WITH validation that submits to a database. It doesn't require a logged in user. No using the form normally via a browser and not filling in all required fields causes validation errors and the form is not submitted. However, I seem to be getting spammed by someone/something. They are filling the generic na...

Cake PHP tree structure and website navigation

Hi there. I wonder if you can help me. I am looking to implement multi level navigation, parent section, child, grand child, etc which in cakePHP is straight forward enough using the tree data structure. However, in terms of the front end, I don't want to just output all pages in the structure. I want to only output the structure of th...

Model class not found

I am trying out cakePHP so I have a very simple site. I get the following error. class Tag extends AppModel { $name = 'Tag'; } Fatal error: Class 'Tag' not found in /home/downtown/public_html/test_cake/cake/libs/class_registry.php on line 140 in ..\app\models\tag.php I have class Tag extends AppModel { $name = 'Tag'; } What s...