Re: Not allowed use mod_rewrite... Trying to get pretty urls to work... No css or js

2014-12-17 Thread glk
Thinking... I wanted to add the following info:


ServerName mydomain
ServerAlias mydomain.tld
DocumentRoot "E:/mydomaint/app/webroot"

Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all

#ScriptAlias /cgi-bin/ "E:/mydomain/cgi-bin/"
#CustomLog E:/mydomain/app/webroot/log/mydomain_access.log combined
#ErrorLog  E:/mydomain/app/webroot/log/mydomain_error.log
LogLevel warn




-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Not allowed use mod_rewrite... Trying to get pretty urls to work... No css or js

2014-12-17 Thread glk
I have a working "site" on my development machine that uses mod_rewrite.  
However, I'm informed that I will not be able to deploy the site with 
mod_rewrite... so the docs say:

App.baseUrl

If you don’t want or can’t get mod_rewrite (or some other compatible 
module) up and running on your server, you’ll need to use CakePHP’s 
built-in pretty URLs. In /app/Config/core.php, uncomment the line that 
looks like:

Configure::write('App.baseUrl', env('SCRIPT_NAME'));

 Also remove these .htaccess files:

/.htaccess/app/.htaccess/app/webroot/.htaccess

 This will make your URLs look like 
www.example.com/index.php/controllername/actionname/param rather than 
www.example.com/controllername/actionname/param.

If you are installing CakePHP on a webserver besides Apache, you can find 
instructions for getting URL rewriting working for other servers under the *URL 
Rewriting*  
section.

Those are the ONLY changes specified in the docs!
Now the following code in my default.ctp:

echo $this->Html->css('cake.generic.css');

$scriptOptions = array('once' => true);
echo $this->Html->script('jquery/1.9/jquery-1.9.1.js', $scriptOptions);

Produces errors:

"NetworkError: 404 Not Found - 
http://mydomain:8080/app/webroot/css/cake.generic.css";
"NetworkError: 404 Not Found - 
http://mydomain:8080/app/webroot/js/jquery/1.9/jquery-1.9.1.js";

The actual location of the file:

E:\mydomain\app\webroot\css

So there has to be something more to do...  I did NOT remove the loading of 
mod_rewrite on this machine, but there are NO .htaccess files within the 
domain!

Thanks for any assistance,

Greg

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


different css styles for checkboxes

2014-12-17 Thread Radharadhya Dasa
Hi,

Is it possible somehow to have different css classes for members of a set 
of checkboxes?

echo $this->Form->input('groups._ids',
['options' => $fGroups,
 'type' => 'select',
 'multiple' => 'checkbox',
 'value' => $values
 ]);

For example I want the first and second checkbox to have css class "x" and 
third to have "z".


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


REST Application

2014-12-17 Thread Rafael Queiroz
Hi,

I'm baking project and exposing application via REST using CakePHP 2.5.x.
It's fine but this moment i bake add method in User, follows the code:

public function add() {
$this->request->allowMethod('post');
$this->User->create();
if ($this->User->save($this->request->data)) {
$message = 'Saved';
} else {
$message = 'Error';
}

$this->set(array(
'message' => $message,
'_serialize' => array('message')
));
}

Well, i'm using postman for testing requests and create 3 requests:

*1. /app/users/add (GET) *
{
"name": "Method Not Allowed",
"message": "Method Not Allowed",
"url": "/app/users/add"
}

*2. /app/users/add (POST)*
{
"message": "Saved"
}
* no params

*3. /app/users/add (POST)*
{
"message": "Error"
}
* params: { data[User][first_name] : '', data[User][last_name] : '',
data[User][email] : '' }

In the 2 request I do not pass any argument and even then the user is
saved, the validate method is despised.
I need create if for check empty ($this->request->data) or exists solution
more elegant ? If yes, my application have many methods add in others
controllers, don't repeat yourself, how to do ?


-- 
Atenciosamente,

Rafael F. Queiroz

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


CakePHP 2.0 authentication(login) without ctp files but other types

2014-12-17 Thread tech_me
I posted to SO several days ago, but no expected replies.
http://stackoverflow.com/q/27403391

I am now using PHPTAL  which use html instead of ctp 
files.
Is there anyone who use the html files to cooperate with Cake's 
authentication?

Thanks.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Save not escape only field CakePHP 2

2014-12-17 Thread euromark
afaik it only wraps it to be able to safely save it

the data ending up in the db should not be different.
mark


Am Dienstag, 16. Dezember 2014 19:32:10 UTC+1 schrieb John Andersen:
>
> Hi Euromark
>
> Actually CakePHP 2.x does modify the data - it escapes and quotes the data 
> during the save - using the DboSource method value() - found here:
> http://api.cakephp.org/2.5/class-DboSource.html#_value
>
> Called by the DboSource method create() - found here:
> http://api.cakephp.org/2.5/source-class-DboSource.html#974-1021
>
> Enjoy, John
>
> On Tuesday, 16 December 2014 16:56:58 UTC+2, euromark wrote:
>>
>> Actually, the save() etc don't modify your data.
>> They simply store it the same way you give it to them.
>> It might only be displayed this way in your sql backend.
>>
>> [snip]
>>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.