Warning: Illegal string offset '_imagedir' in /home/cakephpf/public_html/lofiversion/index.php on line 545

Warning: Illegal string offset '_emodir' in /home/cakephpf/public_html/lofiversion/index.php on line 546
CakePHP UnOfficial Community Forum > I can't see the point how could mvc make it faster
Help - Search - Member List - Calendar
Full Version: I can't see the point how could mvc make it faster
CakePHP UnOfficial Community Forum > Layouts and Design

champkris
okie.. i know that we should separate business logic from presentation. But for me I think Cake's and other framework's presentation file still contains php tags.

Even worse, these php tags are framework's tags which not only make designer's life harder (as they have to study the code).. but also the css and images will not show up in wysiwyg IDE like dreamweaver as they are all in framework's tag.

I'm cake fan but had to switch to my own code half-way the project due to these reasons. I'm looking for solutions.. If someone know, plz share it.

Or let me know why would you think cake makes designer life easier...I just can't see it yet.

Terminal13
Well, I have wrote one hell of a reply with all my thoughts. You don't have to read it or do exactly as I do, but it's an opinion and some 2-cents from my mind.


Part ONE!

I notice your more a designer than a programmer (which ain't a bad thing) and you have a problem with designing with PHP at the Views.

Although I completely agree with you I do have something to say about the subject.

Personally I'm a programmer with some design skills, so from my point of view it ain't a big problem to place code at my Views. On the other hand I do understand that designers can't program (most of them) so they never will place any type of code at the design the build.

Normally a project is done by 3 different people; 1) Marketeer, 2) Designer and 3) Programmer.
This means the project is build by a simple model:
CODE
- Marketeer creates an idea and works it out (UML diagram's, project sitemap, etc.)
- Designer creates a design for the project based on the ideas of the Marketeer.
- Programmer builds the project based on the ideas of the Marketeer and transforms the design into the project.


Based on this ProjectModel you see that a designer NEVER does anything with the code behind the project nor does it need to code anything inside the design.
The only time a Designer has to do anything with the code is when the design contains things that can't be done (eg cross-browser) and has to be redesigned based on the directions of the Programmer. But even then the Designer never touches the keyboard for coding.

My conclusion based on all of the above is very simple: Split your project and for each step think only about the things your doing at that time (designing, programming, testing, etc.).


Now the second part of my story tongue.gif

If you maintain the model as explained on the first part you never have any problems with WYSIWYG editors. Although I hate them (due the bad code they produce) I also use Dreamweaver for coding, but without the WYSIWYG functionality. This way I fully control the code and scripts I write.

"But how do I test if it looks good?"
Well, just open some different browsers (Firefox, IE6, IE7, Opera, Safari, etc) and check the pages you build. This way you can check if it works and if all the browsers show the same. It requires a little more ALT+TAB, but in the end it pays of because you don't have to rewrite your CSS after everything worked at one browser, but not at the others...
So that's why I never have the problem of not seeing CSS and/or Images while coding my Views.


And of course, a third part tongue.gif

You posted that CakePHP and other frameworks requires PHP inside Views, which is true. BUT... I never seen any website with server-side-scripting which didn't had any type of script inside the views. Although I must admit that my own Template Engine only has html comment blocks which do the trick, but still it's not what a Designer created, but has been added by the Programmer.

Also the most used Template Engine in the world (Smarty) has some very ugly smarty-only php tags, while frameworks like CakePHP has the possibility to use any type of PHP to do what you want.

Another big advantage of CakePHP (or any other Framework) is DRY aka 'Don't Repeat Yourself'. This means you don't have to rewrite/redesign you code/design for each single page or element. This should make it easier for both the designer and the programmer, because both has do do less work.
intrinsical
Remember, a "view" in cake does not necessarily mean html. A cake view can also generate xml, json or even an image as it's output. As such, I consider cake views as the scope of the programmer and not a web designer.

Honestly in this day and age of web design, a designer should be able to do just about everything through the use of cascading style sheets. Remember, html is meant to present textual information. Html is not a design tool nor a design language.
champkris
Thanks guys.. appreciate all the answers. Now I'm digging in joomla code. Heard that they use cake for 1.5
Stickymaddness
QUOTE (champkris @ Jul 1 2008, 03:56 AM)
Thanks guys.. appreciate all the answers. Now I'm digging in joomla code. Heard that they use cake for 1.5

No, it doesn't. The new version of Mambo is being developed with cakephp, but afaik it isn't out yet. For Joomla 1.5 they used an MCV pattern, but it wasn't developed with cake.
Terminal13
QUOTE (champkris @ Jul 1 2008, 03:56 AM)
Thanks guys.. appreciate all the answers. Now I'm digging in joomla code. Heard that they use cake for 1.5

As far as I know Joomla never has and never will use CakePHP as a core framework.
Although there are some plugins/components/etc available for Joomla which can act like a bridge between Joomla and CakePHP.

On the other hand, there is another project which was build on Joomla code, but will be rebuild completely into CakePHP. The name of that system is Mambo. But it might take a while till it's ready.

Terminal13
msnmnk
hey
QUOTE
Terminal13
you have post such a good knowledge thanks for nice sharing
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.
Lo-Fi 1.1 iDS Beta, Originally written by Matt,
re-written by Shaun Harrison, Layer 04.com, for pre IPB2.0 versions.