cakephp

CakePHP - how to use $html->link inside an element

Hi, How can I use $html->link from within an element? Thanks, Tee ...

CakePHP call to member function on non-object

I have the following Model and Controller files, and when i visit this url, http://....../pois/index i get this error: Notice (8): Undefined property: PoisController::$Poi [APP/controllers/pois_controller.php, line 5] Fatal error: Call to a member function find() on a non-object in /home/joecoyle/public_html/app/controllers/pois_contro...

CakePHP accessing other controllers

CakePHP Newbie :) I am having trouble accessing another controller and passing that data to a view in one of my controllers: In controllers/landings_controller.php: var $uses = 'User'; function home() { $userdata = $this->User->read(); $this->set(compact('userdata')); } In views/landings/home.ctp: <?php echo $this->us...

Non Working Relationship

Hello everyone, I got a problem with cake's model architecture. I got a Users-Model and a Metas-Model. Here are the model codes: Users: <?php class User extends AppModel { var $name = 'User'; var $validate = array( 'username' => array('notempty'), 'email' => array('email'), 'password' => array('notempty') ); var $dis...

Cakephp Function in mode not executing

I have a function in my Comic Model as such: <?php class Comic extends AppModel { var $name = "Comic"; // Methods for retriving information. function testFunc(){ $mr = $this->find('all'); return $mr; } } ?> And I am calling it in my controller as such: <?php class ComicController extends AppController...

Can not get session in cakePHP.

Hi all, I have problem with session in cakephp.I have one file chat.php that is in webroot folder but when I run that file with ajax I could not find session which is created from chat.ctp file. so anyone has idea how to get session in third party file in cakePHP. can I write session any .ctp file ? Thanks.please help me. ...

CakePHP auth component password inconsistency

Hi, I managed to get authentication to work by following the tutorial from this page http://planetcakephp.org/aggregator/items/2604-create-simple-user-authentication-using-cakephp%E2%80%99s-auth-component How do I make sure when I'm in the register page, and the password and confirm password the user supplied doesn't match, the passwor...

Three questions before I leave PHP: Formsets, datasources and remote auth

I've been using CakePHP for a long time now and feel comfortable developing sites with it. I do however like Python more then PHP and would like to move to Django. EDIT: split in three separate questions How can I mix multiple models in one form? I know formsets are used for this, but I can't find a decent tutorial on this (views + tem...

Cakephp, title_for_layout on Pages Controller

I cannot set title_for_layout on the default PagesController that comes by default with cakephp 1.3. I am using the following code on the display function: $this->set('title_for_layout','some title'); What am I doing wrong ??? ...

how to get 12 for joel test working in a small team of 3-4 on php website?

Hi, I read this and I was inspired. I am asking for specific help to achieve a 12 for my current project. I am working in a team of 3-4 on a php project that is based on cakephp. I only have a dedicated server running on linux which i intend to have the website live on and i have a plan with assembla where i am using its svn repositor...

CakePHP - Have the label and form in Form helper on different line

Hi, I'm using this code now echo $form->input('username'); How do I make sure the label shows up on a different line than the input field? I managed to imitate what I'm trying to do, just want to make sure that I'm using it the right way. echo $form->label('username', 'Username'); echo $form->input('username', array('label' => false...

Cake php menu generation

hai everyone........ I am trying to generate dynamic menu according to the user permission given with ACL component in cake php.. ie., if a user logins, i need to check which all actions are permitted for that specific user and according that list of actions i need to generate menu can any one help me to get all the permitted actions ...

cake php AppController and inheritance

hello folks........ In many tutorial of Acl component in cakephp i got instruction that add component either in AppController or in all the other controllers which inherits AppController....... but problem is var $components=array('Auth',Acl); when i use the above line in AppConroller i cant use the Auth or Acl component... but wh...

CakePHP: when using Translatable behavior, how to make English as the fallback language?

Hi, when a certain entry in a table has no translation, is it possible to display the default/english translation instead? Thanks in advance! ...

What does RETURN TRUE do in a php function?

I was just looking at this code and i don't understand what RETURN TRUE does or what the point of it is? Can someone please explain? class Elephpant { public $colour; public function dance() { echo "elephpant dances!\n"; return true; } } Thankyou in advance ;-) ...

Breadcrumbs in CakePHP

I use HtmlHelper from CakePHP to create breadcrumbs navigation for my page... And i set $html->getCrumbs('separator', 'Home Page') to default.ctp and in other views i set $html->addCrumbs('nameLink', 'linkUrl'); All works fine! But when I open my Home Page there is no breadcrumbs, why? ...

Adding an additional link button to a form (using form->create)

I have recently been assigned a CSS & design project that's in a CakePHP environment and would like to know if I can add an additional button to the form, for a "sign up" link. The form is currently: echo $form->create('User', array('action' => 'login')); echo $form->inputs(array( 'legend' => 'Please log in:', 'userna...

CakePHP save without form

I have a photo gallery I'm trying to set a picture as the cover for the album. I have a field cover_id in the albums table that has already been linked to the photos through the model. I'm passing the album_id and photo_id to the controller. I want to update the album.cover_id passed thru the params with the photo_id passed thru the para...

Best way to implement keywords for image upload gallery

I'm starting to spec out an image gallery type system similar to Facebook's. Members of the site will be able to create image galleries and upload images for others to view. Images will have keywords the the uploader can specify. Here's the question, what's the best way to model this? With image and keyword tables linked vi a HABTM r...

What is a RECURSIVE Function in PHP?

Can anyone please explain a recursive function to me in PHP (without using Fibonacci) in layman language and using examples? i was looking at an example but the Fibonacci totally lost me! Thank you in advance ;-) Also how often do you use them in web development? ...