How to make a sitemap.xml with Cakephp2 shell? -


I'm new to KPPP 2 and I have to get some help. I want to create a sitemap XML for the website I created with CakePHP2, but I have no clue how to create a function that will generate XML and save in the webroots file with cakephp2. I have read the official document, but I still can not find the solution

Something like this will only do one Share though.

  Public function display () {$ sitemapData = array (); // Generate a list of models in app $ list = model = $ this- & gt; _generateListOfModels (); // External model model uses foreign currency ($ list model as model $) {app :: ($ model, 'model'); // We need to load class $ newModel = new $ model; If (empty ($ newModel-> actionsAs) & amp; Array_key_exists ('Sitemap.Sitemap', $ newModel- & gt; actsAs)) {$ response = $ newModel- & gt; GenerateSitemapData (); $ SitemapData [$ newModel- & gt; Name] = $ response; } Else {} unset ($ newModel); } // sitemap of static pages $ sitemapData ['page'] = $ this- & gt; _generateListOfStaticPages (); $ This- & gt; Set ('sitemapData', $ sitemapData); } / ** * _generateListOfModels - Generate list of models * * @return [type] [description] * / protected function _generateListOfModels () {// ('model') model list $ appModelClasses = application :: generate items; $ ListOfModels = array (); // Foreach Model foreach ($ $ modelClass as appModelClasses) {if ($ modelClass! = 'AppModel') {// Model App :: Import ('model', str_replace ('model', '' load, $ modelClass)) ; $ ListOfModels [] = $ Model Class; }} Return to $ list; }    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -