I'd start with removing DB connection related settings and replace all
querying to Cake functions - they all look like basic selects/inserts.
Also you could divide whole this code into some controller functions to
tidy it up.
Or read the code, understand it, and make a helper from scratch in
Nice :)
I like the plain design, all seems to work smoothly.
Altho, the grayish text in the Times table is a bit hard to read.
Marcus Silva pisze:
Hi folks,
Been a while since i last posted in the group, but I have just put one
of my websites online which was developed using cake...
Nice job!
Awesome design!
Made the graphics/layout yourself or you have an artist to do the artwork?
Miles J pisze:
I redid one of my old sites in CakePHP, it can be found here:
http://www.sc2armory.com/
Another app of mine is: http://www.gamesync.com/
Check the Containable behavior.
Helped me alot when I was dealing with complex relations on different
depths.
http://book.cakephp.org/view/474/Containable
justclint pisze:
Im pulling the data successfully but Im trying to get the name value
as opposed to the id value in a separate table.
This is the code I'm using, works 100%.
function login() {
$this-layout = 'login';
if ($this-Auth-user()) {
$this-User-id = $this-Auth-user('id');
$this-User-saveField('last_visit', 'now()');
$gr =
or try using containable behavior:
http://book.cakephp.org/view/474/Containable
hahmadi82 pisze:
bump
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
CakePHP group.
To post to this group, send email to
maybe try this:
function login() {
if (($this-Auth-user() )
!($this-Session-read('Auth.User.online'))){
$this-Session-write('Auth.User.online', true);
$this-Session-write('Auth.User.host', {function of your
choice});
It's a bit weird, especially that calling the same function to edit the
record returns the proper id.
i use the same property with such syntax:
if ($this-Design-saveAll($this-data))
{
$this-notify(2,$this-Design-id);
Hi all,
I've run into a weird problem.
I have two models, not directly related, but I need data from model A to
modify model B find results using ModelB::afterFind();
In model B, i use this:
$myModelA = ClassRegistry::init('ModelA');
this returns no error.
but when I do
$values =
','modelnameB');
2009/5/11 Faza f...@ansi.pl
Hi all,
I've run into a weird problem.
I have two models, not directly related, but I need data from model A to
modify model B find results using ModelB::afterFind();
In model B, i use this:
$myModelA = ClassRegistry::init('ModelA');
this returns
Thanks for the reply,
I've misunderstood the concept of model, which is only the schema layer.
I wanted the model to act as controller...
After reviewing the relations, I've added some containable and now I
have acheived the result the proper MVC way.
Flipflops pisze:
Hi Faza
I don't
Hi!
Have all your .ctp layouts in app/views/layouts, and add this in your
AppController:
$layout = 'my_site_wide_layout'; //notice no .ctp in the value.
Works for me.
remember that each layout must have a $content_for_layout variable so
cake will be able to parse views into this layout. For
could you post debug($this-data) from the controller after the form is
submitted?
Usually when I need defaults, I set them at DB-level, never bothered to
have Cake set defaults for me.
WebbedIT pisze:
Here is my data array ... as you can see a lot of fields that a user
would have to enter
I think you have forgotten to add this to controller beforeFilter():
function beforeFilter() {
parent::beforeFilter();
$this-Auth-allowedActions = array('logout', 'initDB');
}
http://book.cakephp.org/view/643/Preparing-to-Add-Auth
also, I'm not sure but I've read
Hi guys,
I'm curious if there is a built-in method to get an array which is a
result of comparing two other arrays with the same structure?
Like
$a = array('k1' = 'v1', 'k2' = 'v2', 'k3' = '')
$b = array('k1' = '', 'k2' = 'v2', 'k3' = 'yo momma')
comparison of the two would give
$c =
Although not a best way to achieve this, but so far this is my method:
login function stores users ACL group in Auth.user.group:
$gr = $this-User-Group-findById($this-Auth-user('group_id'));
$this-Session-write('Auth.User.group', $gr['Group']['name']);
in view i put this: (yes, I
Makes sense, I'll give it a try.
Thanks!
Brendon Kozlowski pisze:
I *think* you're looking for array_diff_uassoc --
http://php.net/array_diff_uassoc
On Apr 29, 2:15 pm, Faza f...@ansi.pl wrote:
Hi guys,
I'm curious if there is a built-in method to get an array which is a
result
Okay, when you remove the right, the checking function will just not
return true, so in the end the expected result is achieved.
Care to write up some example?
sdc53 pisze:
Thanks Faza - but that doesn't work because that makes the assumption
in the view that the group would always have
LOL their models require you to actually type the SQL queries by hand...
I vote spam of the quarter...
Dardo Sordi Bogado pisze:
We should start giving prices like Spam of the month
On Wed, Apr 29, 2009 at 6:35 AM, celeroo celeroo.analyt...@gmail.com wrote:
Hi,
Here is a nice simple
$array[key]
??
Dave Maharaj :: WidePixels.com pisze:
How can i get the value of a key?
the array is from debug($requests);
for example my array is:
Array
(
[0] = jkl
[1] = ii
[2] = yyy
)
thanks,
Dave
--~--~-~--~~~---~--~~
You set-up a view in your database, and then add the model as for any
other table in CakePHP.
Dunno about other DB's, but since few releases PostgreSQL allows
INSERT/UPDATE of views. Pretty neat feature, because - if keyed
correctly - you can make all relations DB-side.
brian pisze:
On Fri,
/4/23 Faza f...@ansi.pl:
Hi all,
more newbie questions on the way.
I have few models related (mostly $belongsTo), and one of them requires
a level 3 recursion, which is not-a-very-good practice. Especially that
enabling lvl 3 recursion gathers much more data from the model than I
really need
Hello again,
this is the array I'm working on:
Array
(
[0] = Array
(
[Design] = Array
(
[id] = 39
[design_no] = 1
[job_title] = gjgfjyjgyjf
[expected_date] = 2009-04-14
Hello there!
I did my first install following the below tutorials:
http://book.cakephp.org/view/29/Installation-Preparation
http://book.cakephp.org/view/32/Installation
(NB it's for Linux)
Don't have any experience with CakePHP installed on Windows, so probably
someone could provide a link for
'] = $statusHistory;
}
Job done!
hth
grigri
On Apr 24, 9:16 am, Faza f...@ansi.pl wrote:
Hello again,
this is the array I'm working on:
Array
(
[0] = Array
(
[Design] = Array
(
[id] = 39
[design_no] = 1
I use database views, at least for the view pages, if possible.
It's faster to perform joins db-side, and then return just a simple view
to CakePHP.
My 0.02USD
Dave Maharaj :: WidePixels.com pisze:
I was hoping to get some general tips on how to speed up load time and cut
down on the
Make sure that the directory is chown to www server's user.
e.g. in my Debian I did:
chown -R www-data:www-data /path/to/cake/
chmod -R 755 /path/to/cake
chmod -R 777 /path/to/cake/tmp
Never had any permission-related issues.
Nature Lover pisze:
Hi!
I have downloaded CakePHP latest stable
Hi all,
more newbie questions on the way.
I have few models related (mostly $belongsTo), and one of them requires a level
3 recursion, which is not-a-very-good practice. Especially that enabling lvl 3
recursion gathers much more data from the model than I really need.
Therefore I thought
Shit,
i've made mistake on describing the resulting array.
Of course all arrays (new, assigned, editing) are sub-arrays of [0].
sorry for the mixup
Faza pisze:
Hi all,
more newbie questions on the way.
I have few models related (mostly $belongsTo), and one of them requires a
level 3
want to do it using Cake or just plain good ol' SQL? Also, is it a
one-timer, or is it a part of your site logic?
smithtrev...@googlemail.com pisze:
Hi,
I have a question, if I wanted to update a foreignkey field in a
table, based on a date range in another table (eg. it has an id,
First, create a model with the $useTable = false declaration:
app/models/mypage.php
?php
class MyPage extends AppModel {
var $useTable = false;
}
?
Then, define an empty action in a controller, like
app/controller/mypage_controller.php
?php
class MyPageController extends AppController {
Hello!
I've noticed, that by default, Auth loads and saves to Session every
field from the users model, except the field designated as the one with
password.
In my case, the user model contains fields which I don't want to be
stored in session.
I've read the AuthComponent API, but so far it
-check(your acl info)) {
$this-set('admin', true);
}
Then in your view you would simple check the $admin variable:
if ($admin) {
You html content.
}
Hope that helps.
On Apr 6, 4:20 am, Faza f...@ansi.pl wrote:
Hello all,
just happily finished setup of group-based ACL in my
Hello,
this is the scenario:
- I have a rather large form with some production details, blahblah. One
of the inputs can contain value from over 1300 available (more to be
exact, because it's ID, dimensions and layout - 5 to 7 fields each)
- as it would be silly and resource-hungry to parse
, 9:32 pm, Faza f...@ansi.pl wrote:
Hello,
this is the scenario:
- I have a rather large form with some production details, blahblah. One
of the inputs can contain value from over 1300 available (more to be
exact, because it's ID, dimensions and layout - 5 to 7 fields each)
- as it would
If your database supports it, I'd suggest using views.
It's much faster than re-filtering the results in Cake, especially that
you can create views using SQL code on-the-fly.
This way you could still use a single model but change the $uses value
dynamically. (A theory, haven't tested it)
Still,
Hello all,
just happily finished setup of group-based ACL in my app, thanks to
brilliant tutorial on Cake site.
Nevertheless, despite looking around I haven't found any way (known to a
noob like me) to use a function similiar to $this-Acl-check() in View,
for, say, hiding certain sections of
37 matches
Mail list logo