cakephp

CakePHP routing with colon seperator

I need to create routes that include a colon to produce URLs like http://app.com/prjct:a9b5c. Obviously it's currently simple to use a slash instead with the default routing. $SLUG = array('slug' => '[-_A-Za-z0-9]+'); Router::connect('/prjct/:slug', array('controller' => 'projects', 'action' => 'show'), $SLUG); But routes specificatio...

Variable in cakephp configuration setting

Hello all, There could be a vary simple way to achieve what I am trying to do in cakephp but I am unable. here is what I am trying to do : I have a settings file which I read through configuration object and the setting as $config['pageMeta']=array( '1'=>array('desc'=>'<?php echo $param1 ?> some data, <?php echo $param2 ?> some conten...

Drawbacks of cakePHP framework

hello friends, Can any one list me out what are the drawbacks of CakePHP framework over other PHP frameworks? 1) And please explain why that missing feature is so important for a PHP project? 2) How that missing feature help the web developers those who using the Framework with that feature? ...

How do I get associated models to run __construct ?

Little history; I hate the fact that I can't use enums in CakePHP, but I get it. However, another pet peev I have is that my Booleans return 0 or 1 and there is no way to universally turn them to yes' and no's. So I though I would create a little function in the afterFind method of the AppModel to do this for me. The first step I wante...

CakePhp or Elgg

I'm attempting to create a social network and i want it to be similar to how facebook is designed, but with many major changes to the interface and an entire new montezing system. Should I use elgg, CakePHP, or maybe something else(needs to be PHP)? ...

Is it possible to access an external asset directory with the CakePHP Image helper?

Hi. My CakePHP Folder Structure 1. app / webroot / img 2. cake 3. vendors 4. assets <?php echo $html->image('cake_logo.png', array('alt' => 'CakePHP'))?> Is it possible to access my external asset directory with the CakePHP Image helper? ...

CakePHP, HasMany Relationship

Is it somehow possible to create a hasMany Relationship which makes use of an ID outside of the Model? For example one User has many Comments, but I would like to find just the comments of the logged in user: public $hasMany = array( 'MyComment' => array( 'className' => 'Comment', 'foreignKey' => 'user_id', ...

How can I render existing view for output to PDF?

I am using the TCPDF app in CakePHP as a vendor. I have everything setup according to the instructions. I am able to produce a valid PDF and it works great. Now I want to take the results of an HTML rendered view that already exists and create a PDF from it. I set the HTML variable and use that in the view as: $pdf->writeHTML($html, tru...

CakePHP 404 on existing controller

(I'm really hoping I put in enough due dilligence on google and the search bar before posting this) I'm getting started with CakePHP and just created my first model, controller, and view. When I browse to http://localhost/~me/MyApp/Lists I get a 404 and I'm not sure why Here's my controller <?php class ListsController extends App...

A problem with cakephp project

hello folks, I am developing a site which is clone of swoopo auction site and its use cakephp framework. there is integrated FCKEditor and it is not working. It is gives me following error massage. The requested URL /js/fckeditor/editor/fckeditor.html was not found on this server. Additionally, a 404 Not Found error was encounter...

CakePHP project Issue(FCKEditor and Broken links)

Hello Friends; I am working on a project which is auction site and it is actually clone of www.swoop.com this clone is developed on CakePHP platform and I have a issues there. I purchase that script from http://www.moneymakersnetwork.info/products/Swoopo-Clone-PHP-Script.html and there is a demo http://demo.bidscout.net username- d...

debugging using xdebug and cakephp in eclipse PDT

Hi I'm working on one web application. I wanted to provide interactive debugging to my web application, so i have installed xdebug on my machine( windows ) successfully. Done with all the configuration settings in php.ini file. I am able to debug normal php scripts except cakephp project. I hv used cakephp and eclipse IDE for developm...

CakePHP - Image cannot be displayed because it contains errors

While serving images through CakePHP, I'm getting The image "http://DOMAIN/PLUGIN/images/image.png" cannot be displayed, because it contains errors. There is a bug report already existing, http://cakephp.lighthouseapp.com/projects/42648-cakephp/tickets/864 As mentioned in the above bug report, whitespace is the culprit here....

How to setup multiple subdomains on lampp?

Hi , I need to set up multiple projects on lampp. How can i create sub domains for these multiple projects. My projects are in cakePHP. Can anyone help me? ...

Where do I define view functions in CakePHP?

Hi, I have a modifier procedure to show the "date" of an event. if($event['Event']['is_multi_day']){ if( date('n',strtotime($event['Event']['start_day']) ) == date('n',strtotime($event['Event']['end_day'])) ) $date = date('j',strtotime($event['Event']['start_day'])).' - '. date('j',strtotime(...

find the user who is trying to create a directory

Hello I am using cakePHP's bake console to create a cakePHP application. But when I run the scripts, it says that the present user does not have permission to create a folder in the directory. So to find out the user who is being denied, I echoed whoami from the PHP script, and got the user. Now I made that user the owner of the director...

cakephp is not able to connect to database...

Hi guys I am a cakephp newbie and I tried to setup my connection to mysql. I had it worked before but after I changed my mysql database name, it won't connect anymore even thought I changed the database name in database.php inside the config folder. Do I have to run the cakephp console again?? Your tmp directory is writable. The File...

newbie Cakephp issue!!

Hi guys I am a cakephp newbie and I had trouble to view the files under the view folder through browser. I used cakephp console to bake model, controller and views. (ex: Invoices_controller.php for controller, invoice.php for model and a invoices folders under views folder). According to the tutorial I read, I can access the invoice vi...

How do I update 1 field in CakePHP?

Hi, I want a function to alter one field, "is_featured" to 1(true) of Event model of given ID, to mark an event as "Featured". class EventsController extends AppController{ function feature($id){} } ...

How do I run an update query?

Hi I want to do this. UPDATE images SET is_primary = 0 WHERE event_id = $id from events controller, where Event hasMany Image. ...