hello.
is there any clever (simple?) way to manage the missing argument
error?
for example:
if i call directly from the browser's address bar an url like this
http://localhost/cake/myapp/myctrl/edit/; (please note the missing
id)
PHP will prompt me an error like this
Warning (2): Missing
Hi,
El 30/11/2009, a las 9:16, Ernesto escribió:
but that's unconfortable...
My approach:
in controller...
function edit($id = null) {
if (!$id) {
$this-Session-setFlash('INvalid URL');
$this-redirect (array('action' = 'index');
}
//
similar to my approach.
too many ifs in my controllers.
On 30 Nov, 09:20, Fran Iglesias cakephpi...@gmail.com wrote:
Hi,
El 30/11/2009, a las 9:16, Ernesto escribió:
but that's unconfortable...
My approach:
in controller...
function edit($id = null) {
if (!$id) {
Hi again,
El 30/11/2009, a las 9:35, Ernesto escribió:
too many ifs in my controllers.
It think this is unavoidable.
Setting the argument with a default value of null avoid the PHP error
of missing argument,
function edit($id = null) {...}
but you need to give some response to the
Somehow the url's for my paginations looks like:
.../articles/page:2/page:2
.../articles/page:3/page:3
After I click on next page, they looks like:
.../articles/page:2/page:2/page:2
.../articles/page:3/page:3/page:3
My controller:
function articles ($id = null)
{
Hello,
my suggestions are:
- clean your code from outcommented waste/old stuff (its just much)
- use cake's ORM instad of query()
- use cake errors or session-setFlash instead of render('errors/
blah')
- docblocks make no sense if you do not describe the usage of the
method or the meaning of the
i have fixed the problem
On Nov 29, 7:37 pm, bryan de asis bryandea...@gmail.com wrote:
Hi I'm having problem with this method,
it is not saving or updating,
can you please help me and tell me what is wrong with the code below.
I'm Using cakephp 1.2.5
public function
Hi
I am relatively new to cake-php but i like it very much. But in my
current project i have a problem regarding having query
I have a Model called User and other model called Album.
Now i want to display a list of users having at least one Album. My
user model has others relations also like
Hi, I am cakePHP learner..
I am making an simple application like Quick post of jobs *in* this I want
to implement the *Captcha* *in* my form.For this I help from the link :
http://bakery.*cakephp*.org/ goog_1259558951763articles/view/improved-*
captcha* goog_1259558951763-component
I have added
Hi all,
i am new to cakephp. i have created an application have two
functionality on single form.
i am using cake 1.2.5.
here is my application:
i have customer form. this form contains bellow fields,
1. input box customer name
2. input box customer account no and form for insterting address
3.
I try to learn and to use cakephp in the right way. This is just a
base general code and I am trying to improve it. Especially I am
interested in the vulnerable side and ways to fix this. Thanks for
feedback and suggestions. :)
On 30 Nov., 11:48, j0n4s.h4rtm...@googlemail.com
Do you have merge in the view your url params with the PaginatorHelper ?
Something like this ?
$paginator-options('url'=array_merge(array('lang'=$lang),
$this-passedArgs));
On Mon, 2009-11-30 at 01:22 -0800, Mono wrote:
Somehow the url's for my paginations looks like:
Make sure you have the line:
var $components = array('Captcha');
var $helpers = array('Captcha');
..in the controller that is calling the component.
As a general help point, if you click the Notice (8) link, you'll
see a lot of useful information that can help track down an error.
On Nov 30,
Thanks for your reply now I am getting.. captcha image...
but how to check after submitting form whether the entered captcha is
correct?.
Thanks,
Vidya
On Mon, Nov 30, 2009 at 6:42 PM, jburns jeremybu...@me.com wrote:
Make sure you have the line:
var $components = array('Captcha');
var
I have had a quick scan through the code (I haven't used this before)
and it appears it is this line that does the validation:
function add() {
if (!empty($this-data) $this-Captcha-protect()) {
$this-ModelName-save($this-data);
}
}
On Nov 30, 1:16 pm, Vidya N
I'm not 100% sure what your question is. This may help you:
http://book.cakephp.org/view/75/Saving-Your-Data#counterCache-Cache-your-count-816
counterCache is a nice way to track count of related data. Then you can
just do a find where album_count 0
On Mon, Nov 30, 2009 at 12:26 AM, Gaurang
crisuwork will you import the code to the subversion repository please?
thank you
On Mon, Nov 30, 2009 at 6:06 AM, crisuwork maran.e...@gmail.com wrote:
I try to learn and to use cakephp in the right way. This is just a
base general code and I am trying to improve it. Especially I am
Are u sure the logoffs are caused by Ajax-Calls? I think its à Session
time issue. Change the Time in Core.php.
On 29 Nov., 14:55, Ixus asumaw...@gmail.com wrote:
Hi, I'm wondering if it's normal that my application logs out a user
after let's say he clicks a checkbox like crazy which triggers
hello.
i have a multi-app environment wich is working ok.
some apps are very similar each other.
is it possible to create a class like Apps_Controller (or Apps_Model)
and share it across many apps?
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP
Thanks for the replies so far. To answer the question about relations,
this would be something like the following:
A User as has a Profile, a Rank and multiple Ratings and multiple
Tags, which are indexed in a lookup table called Tagtaxonomy. These
Ratings are in turn related to Posts.
I would
I don't know how to import the code to the subversion repository. I
don't see any option for that. Can you give me some tips for that
action?
On 30 Nov., 15:11, Dave davidcr...@gmail.com wrote:
crisuwork will you import the code to the subversion repository please?
thank you
On Mon, Nov 30,
Yes you can. For example:
Create CoreAppController base class with all common methods
Extend CoreAppController in app_controller.php:
require_once 'path_to_core_app_controller.php'; (use App::import()
instead)
AppController extends CoreAppController {
//for Controller callbacks
Hi Dave,
I import the code of app in repository folder.
On 30 Nov., 16:07, crisuwork maran.e...@gmail.com wrote:
I don't know how to import the code to the subversion repository. I
don't see any option for that. Can you give me some tips for that
action?
On 30 Nov., 15:11, Dave
Hello, I´ll try to make a web app for a small business owners web
presence. I found cakephp as the right tool for fast development.
Now I have wrote my model and controller classes and the views. In the
layout I would like to switch the visability of the menu by a simple
Callback function.
Am I
I wrote an article on this just last week; this might help:
http://www.jeremy-burns.co.uk/2009/11/cakephp-dynamic-navigation-bars/
On Nov 30, 3:53 pm, davido mail.dk.onl...@gmail.com wrote:
Hello, I´ll try to make a web app for a small business owners web
presence. I found cakephp as the right
Hi
I've just started using cakephp, and in the second tutorial, the acl
one, logout() in class userd_controller.php does not seem to work:
function logout() {
$this-Session-setFlash('Good-Bye');
$this-redirect($this-Auth-logout());
}
infact I'm
This regular Expression will force a number between 0-23
Raw Reg ex:
^1?[0-9]{1}$|^2[0-3]{1}$
I'm remembering for php some of these char in the regex provided need
to be escaped.
Formated for PHP:
/^1?[0-9]{1}$|^2[0-3]{1}$/
And here is a good on line real time tester for regular expressions:
Hi people,
I have build my app which consist of many controllers and now i want
to render the data in one page.In particular i use one controller to
get the Timezone of a destination by passing latitude/langitude,as
well as one for weather and one for information.Now i want to put all
this data in
Hi,
?php echo $form-submit('Edit', array('edit.jpg')); ?
Should the code above produce a submit button with my edit.jpg
(located in webroot/img) ?
I've tried this a couple of ways and check the API but even that seems
jacked up as it has the same information for both fields:
Try,
function beforeFilter() {
$this-Auth-logoutRedirect = array('controller' = 'xxx',
'action'
= 'xxx');
}
function logout() {
$this-Auth-logout();
}
On Nov 30, 10:24 am, Lorenzo Bettini bett...@dsi.unifi.it wrote:
Hi
I've just started using cakephp, and in
Have you thought about doing this with CSS?
On Nov 30, 8:12 pm, Al al.scheur...@gmail.com wrote:
Hi,
?php echo $form-submit('Edit', array('edit.jpg')); ?
Should the code above produce a submit button with my edit.jpg
(located in webroot/img) ?
I've tried this a couple of ways and check
This is the syntax to produce what you want:
?php echo $form-submit('edit.jpg'); ?
On Mon, 2009-11-30 at 12:12 -0800, Al wrote:
Hi,
?php echo $form-submit('Edit', array('edit.jpg')); ?
Should the code above produce a submit button with my edit.jpg
(located in webroot/img) ?
I've
I use css as jburns suggested but had a quick glance at the code. If
you just want an image you need to put that in the first parameter
e.g. $form-submit('your-image.jpg');
If you need more control use css with 'class' or 'div', e.g.
$form-submit('Edit', array('class' = 'your_css_class');
Well, It's not very elegant solution and I need to make those inserts
in one transaction.
On 13 Lis, 23:47, David Roda davidcr...@gmail.com wrote:
I would probably split it into two calls
assuming this code is in your Model1 model:
$this-saveAll($data['Model1'], array('fieldList' =
I'm having problems styling the div that is created by the $ajax-
autoComplete() function. My code is identical to the example in the
book - http://book.cakephp.org/view/632/autoComplete. The
functionality works great - the callback works and the data gets
filled in properly. The problem, it
http://www.apachefriends.org/en/xampp.html
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
Hi Petr,
is any idea. How use AUTH for two admin sections?
First: Admin section, when user log. can add new products, and other
informations.
Second: Client admin: user log. can shopping, do order, check
order
I must use ACL or role in user and how i can do, when client login can
view
I have added the CKEditor to cake and changed the js config to only allow
ulli and b tags, but is there a security measure to prevent the user
from modifying the code? I can firebug the editor and add class=something
or what ever and destroy the view. How can you prevent anything like that? I
Thanks for the help.
I kept playing around with it and I realized I made the associations
more complicated than I needed to.
I removed the join tables (menu_item_types, menu_item_subtypes) and
added the association: menu_item belongsTo(menu_type, menu_subtype).
Doing a find('all') on MenuItem
If I understand you correctly, I think you can achieve that by passing
certain parameters to the find() function.
Take a look at these:
http://book.cakephp.org/view/73/Retrieving-Your-Data#find-449
http://book.cakephp.org/view/73/Retrieving-Your-Data#Complex-Find-Conditions-74
I'm new to cakephp,
I've had to do something similar with users in different scopes being in
completely different tables.
I handled it by first making sure all admin actions had admin = 1 in their
urls.
Then in the app_controller's beforeFilter, I checked for an admin action.
If found, I initialized the Auth
What the I thought I tried that. Yep that works although it forces
my images to be too small. I'll try out the CSS way instead. Thank
you!
On Nov 30, 3:51 pm, Brett Wilton bdwil...@gmail.com wrote:
I use css as jburns suggested but had a quick glance at the code. If
you just want an image
OK, so I fixed the mod_rewrite problem, but I still cannot run my test
case. Does anyone have any ideas?
Thanks!
On Nov 30, 6:37 am, Angie angelina.tal...@linmark.com wrote:
I am very new to CakePHP and am trying to write a component for an
existing application. I have written a few lines of
In the beforeFilter in each controller you can specify
$this-Auth-userModel = MODEL_NAME;
that way you can use two different tables separately.
On Mon, Nov 30, 2009 at 6:39 PM, Jeff Deroshia deros...@gmail.com wrote:
I've had to do something similar with users in different scopes being in
I solved this problem by creating a method that returns the video file
using @readfile()
So the source for my embed tag looks like this:
param name=SRC value=/user_files/get_file/?php echo $file_id; ?/
?php echo $session-id(); ?
Then in Controller, I have
function beforeFilter() {
so I figured out that I can access a model to save and retrieve data
from components by saying $myvar = new ModelName();
etc.
I have another model that keeps giving me this error.
Fatal error: Class 'StatisticsUser' not found in ...
the problem that I think I'm having is that this is the join
Just checked on cakes 1.2.5 and 1.2.4 - all fine.
Query:
$this-Test-find(
'all',
array (
'fields' = array ('field3', 'SUM(field1) AS Sum1',
'SUM(field2) AS
Sum2'),
'group' = array ('field3')
)
);
Generated SQL:
SELECT `Test`.`field3`,
I add mine to my own blog. My latest is:
http://www.jeremy-burns.co.uk/2009/12/loading-helpers-as-needed/
On Nov 29, 4:44 pm, teknoid teknoid.cake...@gmail.com wrote:
Thank you...
and that's it? ... I was honestly hoping for a little more enthusiasm.
C'mon people I know you got 'em ;)
On
48 matches
Mail list logo