Perhaps you could create an element or helper to act as a kind of sub
view - you move the code that normally be in the view (i.e. looping
through data, building tables etc.) and then return this into a
variable in your view rather than just echoing it. You could then do
what you wanted with it,
Hi everyone,
I got a simple question on the combine function. I want to simplify an
array like for example a groups array:
Array
(
[0] = Array
(
[UserGroup] = Array
(
[id] = 1
[parent_id] =
[lft]
Hi everyone,
My problem is quite simple : i've setup auth and ACL in my application
everything seems to work fine unless one thing :
When a user try to launch a forbidden (for him) controllers/actions,
it' just redirect him to another page autorized for him. I would just
like to have an
On Jun 1, 10:13 pm, havanna thomas.blas...@diacs.de wrote:
SQL Error: 1054: Unknown column 'Array' in 'where clause'
Try to post your code - and a debug print of $conditions.
Regards
Jonathan
--~--~-~--~~~---~--~~
You received this message because you
If you add an alias to the field list you can do this (I think, again
not tested...)
$this-paginate['fields'] = am( $this-paginate['fields'], array
( 'DAYNAME(Model.field) as `day`' ) );
$this-paginate['conditions'] = am( $this-paginate['conditions'],
array('`day`'='Monday' ) );
but as Martin
Hi all,
I need help in cakePHP.
I am using this framework in my area of work. I have successfully
migrated from the old database that uses an auto increment field as
the primary key to one that uses uuid as the primary key.
unfortunately the users request the old ID to be remain in place so
Thanks for the replies, and apologies for not responding sooner -
busy! I'm going to try your suggestions out later today though, I'll
report back here.
theChrisWalker wrote:
If you add an alias to the field list you can do this (I think, again
not tested...)
$this-paginate['fields'] = am(
Oh yes by the way, the above codes generate this error:
Column 'scp_id' cannot be null
Means there is no value in $newId2
On Jun 3, 5:32 pm, liaogz82 liaog...@gmail.com wrote:
Hi all,
I need help in cakePHP.
I am using this framework in my area of work. I have successfully
migrated from
I have a database setup like this (I know it isnt the best setup but
its out of my power to change it :-(
Basically there are 3 levels of users
- Admin
- Managers
- Staff
Few notes:
-Each member of staff belongs to department
-If the Staffs logon_code appears in the manager table they are a
I tried that but I can't pull the XML out of the action's view file.
I can do it programmatically (file_get_contents) but I need to catch
it in Cake's variables (whichever one it is). How do I access that?
On Jun 2, 10:24 pm, Miles J mileswjohn...@gmail.com wrote:
You could write your own view
I'm looking for the number of rows in Catalog not Product.
$this-Product-Catalog-getNumRows()
On May 29, 8:32 pm, Miles J mileswjohn...@gmail.com wrote:
Why would it be 3, if the rows are 100?
--~--~-~--~~~---~--~~
You received this message because you are
Petr,
Read http://book.cakephp.org/view/428/render.
On Jun 2, 1:40 pm, Petr Vytlačil petr.vytla...@gmail.com wrote:
APP CONTROLLER
function beforeRender(){
if($this-params['controller']=='frontends'){
// This do nothing
$viewPaths =
Do you output auth messages in your layout?
They have their own name:
$session-flash('auth');
I have done something like this in my layout a few times:
if (is_array($messages = $session-read('Message'))) {
foreach (array_keys($messages) as $key) {
$session-flash($key);
Can you try using the MAX() SQL-function?
You could just do a custom query on the database returning just the
number of the maximum value in that column. It should be reasonably
fast if you have the column indexed.
Then you do the +1 thing.
On Jun 3, 11:50 am, liaogz82 liaog...@gmail.com
Hi Petr, I'm not sure what you're asking here... if you just want to
change the layout for an action's view, then set the $layout variable
in the controller like: $this-layout = 'layoutname' where you have
'layoutname.ctp' in /app/views/layouts. Or are you saying that you
want the controller to
My 2¢
If you are pretty happy with the setup and it works for you there is a
quick way to minimize code-duplication. Your sub controllers should
extend the main news controller. (you will have to add a App::import()
at the top of these files so that news controller can be found) THen
you can
Hi, I'm just buttin in with a quick question. Something for you to
check.
There is no other ajax request after the page loads and before the
form is posted? If so then this will also cause problems for
SecurityComponent since the token will be old.
/Martin
On Jun 3, 7:20 am, Miles J
Had an informative discussion on this at Stack Overflow:
http://stackoverflow.com/questions/936203/storing-sort-order-for-items-held-in-an-habtm-association-cakephp
On Jun 1, 9:31 pm, Hiero v25me...@gmail.com wrote:
I have a HasAndBelongsToMany association setup on Videos and Bins: A
Bin can
@JStein
You missed the OR part in the condition!
@Havanna
The condition should be:
... $conditions = array('OR' = array('Immobilien.zip' =
$saZipCodes)) ...
Enjoy,
John
On Jun 1, 11:13 pm, havanna thomas.blas...@diacs.de wrote:
Dear Jonathan,
thank you, for your answer. I thought first
Thank you very much, i've just add :
?php
$session-flash();
$session-flash('auth');
?
and it works now
Bye
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
CakePHP group.
To post to this group, send email to
Hey everyone,
I'm trying to select all of my projects belonging to a client, but I
fail to use generatetreelist and conditions.
I tried :
$this-Project-generatetreelist(null, array('Project.client_id' =
'3'), null, null, '...');
since the second parameters seems to be the conditions in the
yes same error! :(
On Jun 3, 2:47 am, Miles J mileswjohn...@gmail.com wrote:
What about going to
/items/index
Or another action?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
CakePHP group.
To post to this
yes same error! :(
On Jun 3, 2:47 am, Miles J mileswjohn...@gmail.com wrote:
What about going to
/items/index
Or another action?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
CakePHP group.
To post to this
In an attempt to utilize my own ACL system, I have 3 models which I
created:
- Aro
- Aco
- AclPermission
Each of these correlates with the default Cake ACL tables (aros, acos,
aros_acos, respectively). Now I'm trying to write some custom methods
in these models but having no luck. When
it worked thanks
On Jun 2, 10:37 am, brian bally.z...@gmail.com wrote:
On Mon, Jun 1, 2009 at 1:20 PM, cake_baker muni...@hotmail.com wrote:
ok here is the full the details
i'm using a star rating plugin that need user.id in the Session
define('RATING_SESSION_USER_ID', 'User.id');
hey i'm working on comment box so need help
var $belongsTo = array(
'User' = array(
'className' = 'User',
'foreignKey' = 'user_id',
'conditions' = '',
'fields' = '',
Hi!
Does anyone know if there is a good tutorial or helper to have the
datepicker function implemented in cake?
I see in the backery but the tutorial is for cake 1.1
Best Regards
Franco Tampieri
--~--~-~--~~~---~--~~
You received this message because you are
Two different sets of data..
First is with Security component added in app_controller
When I debug
debug($this-data); right before the save
$this-User-save($this-data, true,
array_keys($this-User-$join_table-schema()))
Array
(
[_Token] = Array
(
[key] =
here is the links maybe help you
http://nik.chankov.net/2007/09/13/advanced-datepicker-helper-for-cakephp/
On Jun 3, 7:03 am, Dr.Dran franco.tampi...@gmail.com wrote:
Hi!
Does anyone know if there is a good tutorial or helper to have the
datepicker function implemented in cake?
I see in
Thank you Cake_backer I'm a your follower :D
Best Regards
Franco Tampieri
2009/6/3 cake_baker muni...@hotmail.com
here is the links maybe help you
http://nik.chankov.net/2007/09/13/advanced-datepicker-helper-for-cakephp/
On Jun 3, 7:03 am, Dr.Dran franco.tampi...@gmail.com wrote:
Hi!
create a method in ur component something like this
function checkActionRight($action)
{
$rightCategoryId=$this-Session-read($action.'.right_category_id');
$optionId=$this-Session-read($action.'.option_id');
if((int)$rightCategoryId0 (int)$optionId0)
{
please paste whole error text and address bar text .
--~--~-~--~~~---~--~~
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.com
To unsubscribe from this group, send
yes u can just use the flash method
i m giving the syntax
$this-controller-flash('Sorry! You don\'t have the
rights to access this page','Page for redirection',time in secends to
hold the screen);
On Jun 3, 1:32 pm, Xanax mammer...@gmail.com wrote:
Hi everyone,
My problem is
hi! i am new to cakephp and obviously i have some perhaps typical
problems.
my directory structure:
C:/.../upp/cake/
C:/.../upp/app_upp/
C:/.../upp/public_html/upp/
localhost is set on C:/.../upp/public_html/upp/
I set path
define('APP_DIR', 'app_upp');
define('DS', DIRECTORY_SEPARATOR);
please copy/paste whole error text and address bar text there.
On Jun 3, 3:21 pm, dflow deeepf...@gmail.com wrote:
yes same error! :(
On Jun 3, 2:47 am, Miles J mileswjohn...@gmail.com wrote:
What about going to
/items/index
Or another action?
Hi Guys... I'm making a form and need to put an own css div, so I did
this:
echo $html-div('input text');
echo $form-label('Book.release_date.day', 'Date');
echo $form-dateTime('Book.release_date','DMY','NONE);
So Cake create the div class but it doesn't close the tag...
So what can I do in
You might be onto something there.
Initial profile page loads with a edit button by the users profile section
to update part of the profileclick edit loads the form into a
divsubmit saves the form via a second Ajax request...success: jQuery
effects form fades out...updated selections
On Wed, Jun 3, 2009 at 1:15 AM, Ian R ianrick...@gmail.com wrote:
On Jun 2, 7:45 pm, brian bally.z...@gmail.com wrote:
Model::create() doesn't actually create a new DB record, it just sets
up the model instance. You have to use save() for that.
What i've done in the past when moving an
On Jun 3, 2:00 pm, John Andersen j.andersen...@gmail.com wrote:
@JStein
You missed the OR part in the condition!
@Havanna
The condition should be:
... $conditions = array('OR' = array('Immobilien.zip' =
$saZipCodes)) ...
That OR has no functional meaning (or what? there's only 1 array
I have been struggling with this for about 3 weeks. A variable is not
being created in the pass array. I need the value of project_id to
be included when creating a new risk. The Risks table must have a
value for project_id.
Please, what am I doing wrong here?
==
CONTROLLER
(for context, please read the comments for ticket #5145:
https://trac.cakephp.org/ticket/5145 . I chose continue this
discussion in the google group because it is a more appropriate venue
for this type of discourse).
First, let me state that neither myself or *anyone* on the CakePHP
core team
Hi,
If I understand you properly, the url
http://localhost/PBSRG/cake_1_2/risks/add/1
does not correctly pass $project_id into the controllereven though it
appears in the url.
Try li?php echo $html-link(__('Add New Risk', true), array
('controller'= 'risks', 'action'='add', $project
Unless you have some special reason to change the directory structure
Id say the best thing to begin with is to just extract cake and put
the cake folder into your root folder. Then change the name of the
cake folder to the name of your site and now your application should
be accessible at
There are a number of ways to solve this. You can use inheritance, or
parameters, and setup routes for the parameters.
Venue1NewsController extends NewsController
or
NewsController::news($venueNumber,$moreParams)
I don't think copy+paste is the right solution though.
-Mark
On Jun 2, 9:40
Looks like it's a bad idea to create handmade models named Aro and
Aco. When I change the model names (still referencing the default Cake
tables aros and acos, though), then I'm able to get the expected
results from my custom methods and properties. I chose AclRequester
and AclControlled as my
Excellent post, and thank you for the explanation. I now understand
better how the 80-20 rules applies in the case of a framework the size
and complexity of Cake.
On Jun 3, 10:43 am, jperras joel.per...@gmail.com wrote:
(for context, please read the comments for ticket
You should clean up your table schema, first to get them in line with
Cake's conventions. It'll save you lots of headaches down the road.
CREATE TABLE staffs (
id int(11) NOT NULL auto_increment,
department_id int(11) default NULL,
logon_code char(10) NOT NULL,
forename char(50) NOT NULL,
On Wed, Jun 3, 2009 at 5:32 AM, liaogz82 liaog...@gmail.com wrote:
Hi all,
I need help in cakePHP.
I am using this framework in my area of work. I have successfully
migrated from the old database that uses an auto increment field as
the primary key to one that uses uuid as the primary
Its not the model's I'm having problems with...
it's the setting up of ACL - any ideas?
On Jun 3, 7:17 pm, brian bally.z...@gmail.com wrote:
You should clean up your table schema, first to get them in line with
Cake's conventions. It'll save you lots of headaches down the road.
CREATE TABLE
div class=input text
?php
echo $form-label('Book.release_date.day', 'Date');
echo $form-dateTime('Book.release_date','DMY','NONE);
?
/div
On Wed, Jun 3, 2009 at 10:49 AM, bokerao boke...@gmail.com wrote:
Hi Guys... I'm making a form and need to put an own css div, so I did
this:
echo
On Wed, Jun 3, 2009 at 8:20 AM, Toutankharton toutankhar...@gmail.com wrote:
Hey everyone,
I'm trying to select all of my projects belonging to a client, but I
fail to use generatetreelist and conditions.
I tried :
$this-Project-generatetreelist(null, array('Project.client_id' =
'3'),
I'm not positive about it, but I think you need to add a regexp:
Router::connect(
'/risks/add/:project_id',
array(
'controller' = 'risks',
'action' = 'add'
),
array(
'project_id' = '[0-9]+',
'pass' =
If your models/tables don't follow Cake's conventions, you're going to
cause yourself more trouble than it's worth. Given that Cake's ACL is
already a bear to work with, I strongly suggest you get the other
stuff in order first.
On Wed, Jun 3, 2009 at 2:26 PM, Jenski jenski...@hotmail.co.uk
Is there a helper for a button to clear a form?
I have ?php echo $form-button('Reset', array('type' = 'reset' , 'name' =
'Reset' , 'id' = 'button' , 'value' = 'Reset')); ? which creates the
button but clicking it does nothing.
Am i missing something?
Dave
Hello,
I'm working on a project where I have a number of Parties that are
coming to an Event. A party contains some information including how
many people are with that party. An event can only handle a certain
number of people.
I know I can use countCache to find out the n of parties, but I'd
@paulinthought
I made both of these changes, but no change. Also, using pr
($project_id) in the controller does not display anything (because
project_id is null???)
@brian
I modified my routes to the following, but no change.
Router::connect(
'/risks/add/:project_id',
To pass the variables as an action argument, do it like so:
Router::connect('/risks/add/:project_id', array('controller' =
'risks', 'action' = 'add'), array('project_id' = '[0-9]+', 'pass' =
array('project_id')));
?php echo $html-link('Project', array('controller' = 'risks',
'action' = 'add',
Yeah this is a very complicated setup, its intriguing me to write
something for it, let me think about it more and ill get back to you.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
CakePHP group.
To post to this
@Miles J
When I am viewing a project, there is a link to Add New Risk. When
the user clicks the link, the ID of the project from which they
clicked Add New Risk must be passed to the risk controller.
project_id is a foreign key in the Risks table.
Rather than the user seeing a dropdown and
I've been doing some more research on this. First off, you should
probably make sure that allow_url_fopen and allow_url_include are
disabled in both the php.ini file and the http.conf file in apache.
This will protect you from someone executing code that gets included
via a url.
In regard to the
You should post a trac ticket of this anyways for the team to see.
https://trac.cakephp.org/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
CakePHP group.
To post to this group, send email to
http://localhost/todo/items
Missing Controller
Error: ItemsController could not be found.
Error: Create the class ItemsController below in file: app\controllers
\items_controller.php
?php
class ItemsController extends AppController {
var $name = 'Items';
}
?
Notice: If you want to
Whats the filename of your controller?
--~--~-~--~~~---~--~~
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.com
To unsubscribe from this group, send email to
items_controller.php
On Jun 3, 10:43 pm, Miles J mileswjohn...@gmail.com wrote:
Whats the filename of your controller?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
CakePHP group.
To post to this group, send
http://localhost/todo/items
Missing Controller
Error: ItemsController could not be found.
Error: Create the class ItemsController below in file: app\controllers
\items_controller.php
?php
class ItemsController extends AppController {
var $name = 'Items';
}
?
Notice: If you want to
items_controller.php
On Jun 3, 10:43 pm, Miles J mileswjohn...@gmail.com wrote:
Whats the filename of your controller?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
CakePHP group.
To post to this group, send
I don't understand why if I'm writing a helper I can't catch the
action's view file contents from the beforeLayout method or even
beforeRender. Isn't that part of the purpose??? Unfortunately I'm
not finding much on the internet, either.
On Jun 3, 2:52 pm, Miles J mileswjohn...@gmail.com
False alarm on the Google ads. Turns out you can pretty much run any
kind of ad you want on your site via the query string. For example my
site is a web development blog but if I pass a querystring like this:
http://code621.com/?cars=toyota
Car related ads show up. I always thought it was more
On Wed, Jun 3, 2009 at 4:22 PM, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
Is there a helper for a button to clear a form?
I have ?php echo $form-button('Reset', array('type' = 'reset' , 'name' =
'Reset' , 'id' = 'button' , 'value' = 'Reset')); ? which creates the
button but
I should reclarify my directory structure...
/posts/
.../views/
.../.../index.ctp (xml file)
.../.../xsl/
.../.../.../index.xsl
On Jun 3, 4:21 pm, timtrice tim.tr...@gmail.com wrote:
I don't understand why if I'm writing a helper I can't catch the
action's view file contents from the
Urg, I tryed the datepicker that you suggest me, but doesn't do the right
work...
There is an jquery implementation? Can someone give me a tip or a help ora
alink for a tutorial? I seracherd in google but I didn't find something that
satisfy my problem.
Best regards
Franco Tampieri
Franco
The helper beforeRender()/etc does not catch the output. Take a look
at the methods _render() and renderLayout. They both call
_triggerHelpers() which call the helpers beforeRender()/etc, but dont
catch the data.
--~--~-~--~~~---~--~~
You received this message
I am drawing a blank on this one, any help appreciated. Basically my
view is a calibration record that also needs to be saved in a folder
for backup purposes. Is it possible to save the view as an htm file,
just as if you selected Save Page As in Firefox?
Hi, I searched through the archives and didn't find a solution to this
problem I'm encountering so hopefully someone here will know what it
is. I'm trying to get the contents (image) of a MySQL blob field and
output it. However, it won't display properly.
I have modified my code so that it
Hi there,
I'm another new cakePHP user trying to wrap my brain around this
system. My apologies if this is already addressed elsewhere, but I
just cannot figure this out:
To teach myself Cake, I'm building a listing/review site. As of right
now, I have a
- User, which hasMany 'Review',
You have to send the correct headers before echoing the data. Have a
look at this recent article at the Bakery about doing something
similar:
http://bakery.cakephp.org/articles/view/imagebehavior-best-from-database-blobs-and-file-storage
On Wed, Jun 3, 2009 at 7:49 PM, Jon jon...@gmail.com
That doesn't work, either. To be honest with you, I'm kind of
disappointed there isn't much support to be able to do this. Or maybe
I'm just missing it. But I've searched Google and even posted on
other forums for solutions and have not gotten any responses. It's
almost as if it's impossible.
Why exactly are you going to use xsl?
--~--~-~--~~~---~--~~
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.com
To unsubscribe from this group, send email to
To keep markup separate from php. I'm fixing to hire a designer to
completely redo a website I have and I had decided it'd be much easier
to just redo the views and what-not as opposed to letting him get in
there and potentially jacking tihngs up. I had thought about taking
the Smarty route but
I am having trouble with sessions and a proxy server. My site uses
Auth and ACL and it works fine in all my testing. However, now someone
with Microsoft Proxy server is using it and the sessions are getting
mixed up - when one user logs in they sometimes get another users info
(i.e. the sessions
Good Night,
How can I change the variable $content_for_layout depending on a
situation?
Like if I use and IF and ELSE. For IF the $content_for_layout would
have a value and for ELSE, there would be a different value.
How could I do that?
Regards,
Thnaks for the feedback Mark Martin, I'll have a look at these
options over the next couple of days and see how they work out.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
CakePHP group.
To post to this group,
I keep getting HTML in my AJAX callbacks in Cake 1.2. Does anyone know
why?
--~--~-~--~~~---~--~~
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.com
To unsubscribe
I just finished creating a straight forward uploader component, and im
looking for features and additions. Heres what it currently does.
- Uploads files to app/webroot/files/ (can specify subfolders)
- Logs errors to be displayed to the user
- Support for wide range of filetypes/mimes (image,
Hello,
I have a login screen with username and password. I want to either use my
username or email address in the username field. I tried setting the Auth
fields as listed below but its not working.
$this-Auth-fields = array('username'=array('username',
I suggest that you turn of autoRedirect on login, as described in
http://book.cakephp.org/view/395/autoRedirect and then use something
like the following:
[code example]
if ( !$this-Auth-user() ) {
// The user is not logged in, so try with the email as the
username!
86 matches
Mail list logo