SitePoint Sponsor |
|
User Tag List
Results 151 to 175 of 175
Thread: PHP Retro Style MVC Framework?
-
Oct 28, 2008, 07:35 #151
- Join Date
- Feb 2008
- Location
- Atlit, Israel
- Posts
- 470
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Big big updates to the framework. Using ActiveRecord pattern with custom methods now. Also view handling has been changed. I'll create a tutorial soon covering all of the new stuff and how to use the framework now. I'm sure you're gonna like it. Form handling has been very much improved, as well.
Learn about the new Retro Framework
Code PHP the way it was meant to be coded!
-
Nov 3, 2008, 14:26 #152
- Join Date
- Feb 2008
- Location
- Atlit, Israel
- Posts
- 470
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Video tutorials (previews) on version 1.1
http://retro-framework.com/productions/cv/cv.html
http://retro-framework.com/productio...g/routing.html
http://retro-framework.com/productions/forms/forms.html
http://retro-framework.com/productio..._advanced.html
http://retro-framework.com/productions/db/db.html
tell me what you thinkLast edited by CoderMaya; Nov 3, 2008 at 15:17.
Learn about the new Retro Framework
Code PHP the way it was meant to be coded!
-
Nov 4, 2008, 04:08 #153
- Join Date
- Feb 2008
- Location
- Atlit, Israel
- Posts
- 470
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I'm gonna release 1.1 really soon. Only one question to all of you though... I wanna release it with a sample application. Kind of bored with blogs... any other ideas?
Learn about the new Retro Framework
Code PHP the way it was meant to be coded!
-
Nov 4, 2008, 04:14 #154
- Join Date
- Apr 2008
- Location
- North-East, UK.
- Posts
- 6,111
- Mentioned
- 3 Post(s)
- Tagged
- 0 Thread(s)
What about consuming some sort of API, Amazon etc...?
@AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.
-
Nov 4, 2008, 04:20 #155
- Join Date
- Feb 2007
- Posts
- 251
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
personal finance manager
fitness log
meal planner
event calendar
-
Nov 4, 2008, 04:20 #156
-
Nov 4, 2008, 04:25 #157
- Join Date
- Feb 2008
- Location
- Atlit, Israel
- Posts
- 470
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I don't know what you mean. They look nicer in views... and for the record: my php.ini doesn't allow them. The view parser parses them to proper <?php echo $x; ?> before evaluating.
In fact, you can even use short ASP tags, or just ASP tags, if you prefer. They all get parsed to <?php etc.
I didn't get the chance to work with web services yet, by the way. I'll look into it.
Other than that I like a few of the ideas but I still can't see the one which would be a worthy example of this framework's capabilities.Learn about the new Retro Framework
Code PHP the way it was meant to be coded!
-
Nov 4, 2008, 04:29 #158
- Join Date
- Apr 2008
- Location
- North-East, UK.
- Posts
- 6,111
- Mentioned
- 3 Post(s)
- Tagged
- 0 Thread(s)
With regards to the view parser and short tags, how would the framwork deal with the similar <? tags in say an XML view template?
@AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.
-
Nov 4, 2008, 04:34 #159
- Join Date
- Feb 2008
- Location
- Atlit, Israel
- Posts
- 470
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I never templated with XML but... Since XML's start tag does not contain a space after "<?" there should be no problem.
Learn about the new Retro Framework
Code PHP the way it was meant to be coded!
-
Nov 4, 2008, 04:45 #160
- Join Date
- Feb 2008
- Location
- Atlit, Israel
- Posts
- 470
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
How about a sample forum? Simple one, that is... Users, admins, topics, replies, etc?
Learn about the new Retro Framework
Code PHP the way it was meant to be coded!
-
Nov 4, 2008, 05:01 #161
- Join Date
- May 2006
- Location
- Lancaster University, UK
- Posts
- 7,062
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
I think the forum would be a bit complex - but I suppose it could work.
Before you release v2, we really need to brainstorm a way to boost the productivity of Retro.
Funnily enough I just posted on the retro forum (which needs a link from the retro home page) asking about advancements - before seeing this thread alive again.
Ok, so what I think we need is a lot of built-in objects (it IS a framework, after all). I've been working alot with C# over the last couple of weeks, and I like the way the .net objects work.
So, how about a mimic of that, with (of course) the object-starting function:
PHP Code:echo string('\'ElLo World')->replace('\'', 'H')->toLower()->substring(0, 5); //hello
PHP Code:<?php
$list = listBox('name');
for($i = 0; $i < 10; $i++){
$list->add($i);
}
echo $list;Jake Arkinstall
"Sometimes you don't need to reinvent the wheel;
Sometimes its enough to make that wheel more rounded"-Molona
-
Nov 4, 2008, 06:05 #162
- Join Date
- Feb 2008
- Location
- Atlit, Israel
- Posts
- 470
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
About the string thing, although I would generally create the same object for my apps, I don't want to include it in the framework since I want it to still look a lot like PHP, only with better ways to do it. That doesn't mean you can't include your own object, though, or even put it up as a plugin when I get the full site up.
I also always loved controls but I'll have to see where to integrate them... I mean, I don't want to make things too complex by adding a code-behind file for the view page alone, besides the controller, and I don't really want to instantiate view objects such as a list box inside the controller...
Maybe if I could find a way to integrate everything with controls, to make them be able to accept Records, models, etc, plus other stuff. That way you could create them right in the view and just do something like
PHP Code:<? $list = control('list')->populate($forum_records, 'name') ?>
Learn about the new Retro Framework
Code PHP the way it was meant to be coded!
-
Nov 4, 2008, 08:27 #163
- Join Date
- Feb 2008
- Location
- Atlit, Israel
- Posts
- 470
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Ok so far I built many controls, and it looks like it's gonna be so much easier to use them than writing all the HTML, to be honest.
For example, you can now call a function date_picker_tag() and it would return 3 SELECT tags according to the format you specified it. (Default is d/m/y)
You can also instantiate these objects:
CheckBox, TextBox, TextArea, SubmitButton, ImageButton, TextRotator, ImageRotator, FileBox, CaptchaImage, CaptchaBox, ListBox, RadioList, CheckBoxList.
They all use inheritance so the usage is very much alike.
For a list, radio list, text rotator, etc you would do
PHP Code:$list = new ListBox('name');
$list->add($item);
echo $list;
PHP Code:<?= new TextBox('name') ?>
Learn about the new Retro Framework
Code PHP the way it was meant to be coded!
-
Nov 4, 2008, 08:29 #164
- Join Date
- Feb 2008
- Location
- Atlit, Israel
- Posts
- 470
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Oh and submit and image buttons get a form object. This is the way the framework operates to easily handle multiple forms in one page via objects to know which form was sent.
PHP Code:<?= new SubmitButton($form, 'Send Form') ?>
Learn about the new Retro Framework
Code PHP the way it was meant to be coded!
-
Nov 4, 2008, 09:38 #165
- Join Date
- Feb 2008
- Location
- Atlit, Israel
- Posts
- 470
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Ok the controls changed a bit how you build a form but it's really better this way. Works great, feels good to develop with it.
Video preview:
http://retro-framework.com/productio.../controls.htmlLearn about the new Retro Framework
Code PHP the way it was meant to be coded!
-
Nov 4, 2008, 15:34 #166
- Join Date
- Feb 2008
- Location
- Atlit, Israel
- Posts
- 470
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Version 1.1 BETA with Simple Forum Application up for grabs
http://retro-framework.com/demo.zip
It includes a MySQL backup file in the application folder... You can restore it with MySQL Administrator or PHPMyAdmin.
Default admin user: admin, password: adminLearn about the new Retro Framework
Code PHP the way it was meant to be coded!
-
Nov 16, 2008, 14:39 #167
- Join Date
- Feb 2008
- Location
- end($world)
- Posts
- 834
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I have just downloaded the framework and will try it
I will come back and post my experience here later..
-
Nov 19, 2008, 16:50 #168
- Join Date
- May 2006
- Location
- Lancaster University, UK
- Posts
- 7,062
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
Yam, I keep reporting this - I hope you implement it; it demolishes any chance of having multi-case field names.
The problem?
When a record is grabbed from the db, it is put in an array with the name as the key.
When a record is get or set, it strtolower()s first, meaning it can't find the key if it had capitals. So:
PHP Code:public function __get($name)
{
$name = strtolower($name);
if(array_key_exists($name, $this->_values))
return stripslashes($this->_values[$name]);
throw new Exception('Invalid offset: '.$name);
}
public function __set($name, $value)
{
if($value instanceof RecordField)
$value = $value->get_value();
$name = strtolower($name);
if(array_key_exists($name, $this->_values))
{
$this->_values[$name] = $value;
return;
}
throw new Exception('Invalid offset: '.$name);
}
PHP Code:public function __get($name)
{
if(array_key_exists($name, $this->_values))
return stripslashes($this->_values[$name]);
throw new Exception('Invalid offset: '.$name);
}
public function __set($name, $value)
{
if($value instanceof RecordField)
$value = $value->get_value();
if(array_key_exists($name, $this->_values))
{
$this->_values[$name] = $value;
return;
}
throw new Exception('Invalid offset: '.$name);
}
Jake Arkinstall
"Sometimes you don't need to reinvent the wheel;
Sometimes its enough to make that wheel more rounded"-Molona
-
Nov 19, 2008, 17:14 #169
- Join Date
- Feb 2008
- Location
- end($world)
- Posts
- 834
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I think Yam is on holydays now for a week or two, he mentioned it somewhere. He will probably implement it when he comes back.
-
Dec 19, 2008, 20:37 #170
-
Jan 3, 2009, 08:30 #171
- Join Date
- Feb 2008
- Location
- Atlit, Israel
- Posts
- 470
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Ok I got into a different unit kind of thing so I should have more time, once again, to work on the framwork during my army service.
@jake: Are you sure about your issue, testing-wise? Because the DB object turns all the keys to lowercase with each fetch, anyway. This way you can ask for your fields with any casing you want, because it would always work lowercase, and in the framework it's always lowercase anyway.
@risoknop: Haha, wish it were a holiday.I was stuck in a naval fighting unit in the army. I was moved a few days ago to somewhere else where I should have some more free time and head space.
@rageh: Pagination is something I really want to implement, but I still didn't find the right way I wanna go about it. I want it to be something simple that would integrate well with other parts of the framework (such as records, forms and actions). Once I really get back into it I'll start getting some real work done. Right now, after almost 3 months without even seeing a line of code, or actually a monitor, excluding my lousy NOKIA, it's a bit confusing.Learn about the new Retro Framework
Code PHP the way it was meant to be coded!
-
Jan 3, 2009, 08:45 #172
- Join Date
- Feb 2008
- Location
- end($world)
- Posts
- 834
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
<offtopic>I have made a simple pagination class few days ago. You can use it in the framework if interested though I'm not sure it's how you want it.</offtopic>
-
Jan 3, 2009, 13:48 #173
-
Jan 4, 2009, 02:23 #174
- Join Date
- Feb 2008
- Location
- Atlit, Israel
- Posts
- 470
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Ok, I guess it's because I always use _ci databases, a problem never occurs for me. But it's good point, I'll change it when I get home.
I'm gonna record some videos about the new version and then release it.Learn about the new Retro Framework
Code PHP the way it was meant to be coded!
-
Mar 14, 2009, 02:02 #175
- Join Date
- May 2007
- Location
- Poole, UK
- Posts
- 5,077
- Mentioned
- 103 Post(s)
- Tagged
- 0 Thread(s)
Just giving it a try at the moment, have got as far as the main menu but get a 404 error. Tried to search all the php for what it was looking for "/demo/member/register" but could not find it. Was there a reason for not using PDO for the database connection?
I can't work out what scripts require each other, there are classes that have no code, some files that have more than one class. A few thoughts:
- A php script should be either self documenting or there should be plenty of comments, will the author(s) be able to remember in a couple of years time why they coded things like they did.
- PDO should have been used for the database as gives greater security.
- Each class should be in its own seperate file.
- All configuration information should be kept in a seperate file with perhaps just the db connection info kept in a seperate (probably a .ini ) file.
I also downloaded version 1.0.1 from google code and tried it as it was but it caused an 500 Internal Server Error.
Is there a newer version than 1.0.1 that has not been placed on google code yet (with sql to install)?Community Team Advisor
Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator
Bookmarks