Jump to content

pcreact

Members
  • Posts

    9
  • Joined

  • Last visited

Recent Profile Visitors

2,816 profile views

pcreact's Achievements

Newbie

Newbie (2/6)

2

Reputation

  1. Thank for the reply Soma, $page->render("custom_template.php", array("somevar" => "a value")); That doesn't work for me, is this only available on a dev branch?
  2. Hello, I have a structure set up where I use "templates" like controllers and have my views in a separate /views/ directory. One of my template types is a "pageref-widget", it's basically just a widget that can be dropped anywhere in the site with a reference to a page to pull an overview from (title/intro description/image). In my pageref-widget controller I get a hold on the referenced page object and pass it to my partial view (using TemplateFile). I anticipated populating the view with the referenced page like this: $templateFile->set('page', $referencedPage); I realised when I did this that in the TemplateFile it's version of $page was not $referencedPage but the initial (global) $page object, I need to use $this->get('page') to access my referencedPage variable. It seems more logical to me that if $page has been explicitly passed to a template file that it should be accessible via $page (as all other explicity set non-global variables are), and that the global should need to be accessed via wire('{global}'), can anybody give me some insight into why it is the other way around? Thanks
  3. Hello, Since I last posted I've used processwire to create a simple content managed website and as an API data source for a Content-Publishing mobile application. I still intend on using it as a data source from within the Yii framework for the following reasons: Views I like that processwire gives you a raw template file and allows you to do what you like to output your HTML, but I found myself just trying to re-create the Themes/Layout/Partials structure provided by Yii. Folder/Class organisation With processwire I found myself just adding files to the modules folder, which is fine for a smaller project, but for a large project I would need to implement some sort of system that separated out the different types of modules and organise them accordingly, whereas with Yii I have the out of the box separation of Actions, Behaviors, Components, Extensions, Modules and Widgets. URL Management Processwire URL's were perfect for the small site I built, but I felt I had more out of the box control over URL's using Yii, with it's CBaseUrlRule class. Automated Testing Yii provides support for automated testing: http://www.yiiframework.com/doc/guide/1.1/en/test.overview In Summary - I really like processwire and I will definitely continue to use it stand alone, but I also still see how I could benefit from bootstrapping it into Yii, so I will be going ahead with that also.
  4. Just to clarify, I don't deny it's technically possible to use processwire to build the things I would build with Yii, my main concern is about whether or not PW would be the right tool for the job.
  5. Interesting reply Matthew, Regarding - "The only "advantage" of PHP frameworks over ProcessWire is that frameworks have no back end at all." - I'm sure this is an over-simplification. Maybe it's my inexperience of processwire but it does seem very content-centric, where as I see Yii as a framework that could be used to build any tool or application. The only way I'm going to confirm for myself whether or not this is a good idea is by coming up with some concrete examples....to be continued.
  6. Just thought I should add an update as I promised tutorials! Unfortunately I got massively side-tracked in the middle of my integration and am only now getting back to working with processwire. I am still going to do the integration, hopefully before christmas. I haven't used either Yii or PW for a while, but my motivation was that I am more familiar with Yii and have used it to build complex systems, it provides many helpers and if memory serves me right I remember being able to do much more out-of-the-box with the "view" portion of Yii than I could with PW, but I couldn't find any good pre-built CMS components. That's where I got the idea of using PW purely to build up my content trees and create/access the content via the PW API. Url management, routing, user managerment, templating, widgets, business logic etc would all still be powered by yii.
  7. Hello, I'm developing a module that takes a json string and uses it to create a tree of PW pages. I build up the tree by assigning the parent of every new page. I want this to happen on an all-or-nothing basis, does PW have some sort of wrapper for this or would I need to get hold of the connection object and do a $conn->beginTransaction()...? Any help greatly appreciated, Phil. **Edit** - Sorry I just realised this should probably be in the API forum.
  8. Thanks for your input, the reason I was trying to do this was to get template->filename in the context of my Yii application to reference the template file in my root/to/yii/templates/ folder. I use the same method to set config->urls->root to my processwire folder which works fine. I have realised since that I was maybe on the wrong track, I now just use template->name and handle all of my path generation with Yii.
  9. Hello, I discovered processwire a couple of days ago and I am very impressed so now I am integrating it with the Yii framework (once complete I'll post a tutorial with code), so far it is going well but I do seem to have a problem with setting a new path for a $page->template->filename. Setting $config->paths->templates in the PW config.php file works fine but I want to be able to set Yii-specific config variables after I have included the PW index.php. I assumed that by setting $wire->config->paths->templates that this would be reflected in $page->template->filename but that doesn't seem to be the case. Is this a bug or am I confused? Any advice greatly appreciated.
×
×
  • Create New...