file input box does not return image details in array in $this->data

2010-01-25 Thread codef0rmer
i have a file input box to attach user's photo using e($form->file ('User.photo')); but when i post form, i get following array, Array ( [User] => Array ( [photo] => foo.png ) ) instead i should get the image details regarding image name, type, tmp_name, size like t

Generate valid path like "directory-name-where-the-file-exists/file-name" in view

2010-01-17 Thread codef0rmer
i tried adding image using following code. below code generates "directory-name/add-more.png" path. e($html->image("add-more.png")); I want to add above image using tag through src attribute for some reason and i do not want to use the directory name where the file exists, hardcoded as the direct

Re: how to call Model1->find("all") from Model2 Controller

2010-01-17 Thread codef0rmer
thx guys. Finally, it worked :) Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.c

Re: DATE_FORMAT in fields does not return formatted date under proper Key (Model Name)

2010-01-15 Thread codef0rmer
@Amit Rawat: oh, silly mistake. I really need to keen my observation ;) var $virtualFields = array( 'full_name' => 'CONCAT(User.first_name, "", User.last_name)' ); but the full_name key is not coming in $arrUser = $this->User->find("first", array( "fields" => array(

Re: DATE_FORMAT in fields does not return formatted date under proper Key (Model Name)

2010-01-15 Thread codef0rmer
@Walther: thx i knew, i would get a valid solution. i tried upgrading my cakephp 1.2.5 to 1.3 alpha, but when i use below code in User Model, error comes... var $virtualFields = array( 'name' => 'CONCAT(User.first_name, ' ', User.last_name)' ); syntax error, unexpected T_CONSTANT_ENCAPSED

Re: DATE_FORMAT in fields does not return formatted date under proper Key (Model Name)

2010-01-14 Thread codef0rmer
@John Andersen: thx but there has to be a solution instead of formatting in view file @Azril Nazli: :-( no luck... it says, sql query error. here is the below query: SELECT `GenderSalutation`.`name`, `User`.`first_name`, `User`.`middle_name`, `User`.`last_name`, `User`.`address`, DATE_FORMAT (User

DATE_FORMAT in fields does not return formatted date under proper Key (Model Name)

2010-01-13 Thread codef0rmer
It already ate my 1+ hour to figure out the problem. I hope, i'll get a help here... User Table Structure: id gender_salutation_id first_name middle_name last_name dob email GenderSalutation table Structure: id name I used below code to fetch the full name and formatted dob: $arrUser = $this->Us